Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
shopping-mall
Commits
81ea4103
Commit
81ea4103
authored
Dec 30, 2020
by
Kim, Subin
Browse files
Merge branch 'kimpen' into ourMaster
parents
be7b4dbc
1f2eae00
Changes
21
Show whitespace changes
Inline
Side-by-side
server/schemas/index.js
View file @
81ea4103
import
mongoose
from
"
mongoose
"
;
import
config
from
'
../config.js
'
;
const
connection
=
{}
async
function
connectDb
()
{
// if (connection.isConnection) {
// return
// }
const
db
=
await
mongoose
.
connect
(
config
.
mongoDbUri
,
{
useNewUrlParser
:
true
,
useUnifiedTopology
:
true
,
useFindAndModify
:
false
,
useCreateIndex
:
true
})
connection
.
isConnection
=
db
.
connections
[
0
].
readyState
}
export
default
connectDb
\ No newline at end of file
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment