정승호

all file uploaded

1 +node_modules
...\ No newline at end of file ...\ No newline at end of file
1 +
2 +const express = require('express')
3 +const app = express()
4 +const port = 5000
5 +
6 +const mongoose = require('mongoose')
7 +mongoose.connect('mongodb+srv://platoon07:wony9795!!@2020oss-ysxss.mongodb.net/test?retryWrites=true&w=majority',{
8 + useNewUrlParser: true, useUnifiedTopology: true, useCreateIndex : true, useFindAndModify: false
9 +}).then(() => console.log('MongoDb connected....'))
10 + .catch(err => console.log('Error'))
11 +
12 +
13 +
14 +app.get('/', (req,res) => res.send('Hello world!!'))
15 +app.listen(port, () => console.log('example app listen on port ${port} !'))
16 +
17 +
18 +// mongodb+srv://platoon07:<password>@2020oss-ysxss.mongodb.net/test?retryWrites=true&w=majority
...\ No newline at end of file ...\ No newline at end of file
......
This diff is collapsed. Click to expand it.
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
4 "description": ">20151039045 정승호", 4 "description": ">20151039045 정승호",
5 "main": "index.js", 5 "main": "index.js",
6 "scripts": { 6 "scripts": {
7 - "start":"node index.js" , 7 + "start": "node index.js",
8 "test": "echo \"Error: no test specified\" && exit 1" 8 "test": "echo \"Error: no test specified\" && exit 1"
9 }, 9 },
10 "repository": { 10 "repository": {
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
14 "author": "seungho", 14 "author": "seungho",
15 "license": "ISC", 15 "license": "ISC",
16 "dependencies": { 16 "dependencies": {
17 - "express": "^4.17.1" 17 + "express": "^4.17.1",
18 + "mongoose": "^5.9.15"
18 } 19 }
19 } 20 }
......