Skip to content

Commit 9292bb5

Browse files
author
何柯
committed
absolute path resolve
1 parent 6df3e29 commit 9292bb5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lessons/01-setting-up/server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ var compression = require('compression')
88
var app = express()
99
//must be first
1010
app.use(compression())
11-
app.use(express.static(path.join(__dirname, 'public')))
11+
app.use(express.static(path.join(path.resolve(__dirname), 'public')))
1212

1313
app.get('*', function (req, res) {
14-
res.sendFile(path.join(__dirname, 'public', 'index.html'))
14+
res.sendFile(path.join(path.resolve(__dirname), 'public', 'index.html'))
1515
})
1616

1717
var PORT = process.env.PORT || 8080

0 commit comments

Comments
 (0)