Skip to content

Commit 0995bf0

Browse files
committed
serve static files from public folder
1 parent aa729bb commit 0995bf0

File tree

4 files changed

+2
-1
lines changed

4 files changed

+2
-1
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.

server.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
var fs = require('fs');
2+
var path = require('path');
23
var express = require('express');
34
var bodyParser = require('body-parser');
45
var app = express();
56

67
var comments = JSON.parse(fs.readFileSync('_comments.json'))
78

8-
app.use('/', express.static(__dirname));
9+
app.use('/', express.static(path.join(__dirname, 'public')));
910
app.use(bodyParser.json());
1011
app.use(bodyParser.urlencoded({extended: true}));
1112

0 commit comments

Comments
 (0)