Skip to content

Commit aa88469

Browse files
committed
path module added
1 parent 4153cfd commit aa88469

File tree

3 files changed

+57
-0
lines changed

3 files changed

+57
-0
lines changed

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const express = require('express')
33
const mongoose = require('mongoose')
44
const cors = require('cors')
55
const morgan = require('morgan')
6+
const path = require('path')
67

78
const api = express()
89
const { router } = require('./api/routes')
@@ -27,6 +28,7 @@ mongoose.connect(
2728
.use(morgan('dev'))
2829
.use(cors())
2930
.use(express.json())
31+
.use(express.static(path.join(__dirname, 'public')))
3032
.use('/api', router)
3133
.listen(8080, (err) => {
3234
console.info('\n\n' + '>'.repeat(40))

package-lock.json

Lines changed: 51 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"version": "1.0.0",
44
"description": "",
55
"main": "index.js",
6+
"engines": {
7+
"node": "10.x"
8+
},
69
"scripts": {
710
"test": "echo \"Error: no test specified\" && exit 1"
811
},
@@ -25,6 +28,7 @@
2528
"jsonwebtoken": "^8.5.1",
2629
"mongoose": "^5.12.13",
2730
"morgan": "^1.10.0",
31+
"path": "^0.12.7",
2832
"start": "^5.1.0"
2933
}
3034
}

0 commit comments

Comments
 (0)