Files: d456a6cc8589489e558e6164750474ed2cfc961e / examples / express / index.js
459 bytesRaw
1 | ; |
2 | |
3 | var express = require('express'); |
4 | var app = express(); |
5 | var Server = require('http').Server; |
6 | var server = new Server(app); |
7 | |
8 | server.listen(8080); |
9 | |
10 | // __dirname is used here along with package.json.pkg.assets |
11 | // see https://github.com/zeit/pkg#config and |
12 | // https://github.com/zeit/pkg#snapshot-filesystem |
13 | app.use('/', express.static(__dirname + '/views')); |
14 | |
15 | app.get('/', function (req, res) { |
16 | res.sendFile(__dirname + '/views/index.html'); |
17 | }); |
18 |
Built with git-ssb-web