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
ba69b228
Commit
ba69b228
authored
Dec 30, 2020
by
Jiwon Yoon
Browse files
Merge branch 'ourMaster' into jiwon
parent
96cfb62a
Changes
21
Show whitespace changes
Inline
Side-by-side
server/schemas/index.js
View file @
ba69b228
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