Files: ca90b5ca0579ebdcc0635288bce4978e3fb200f5 / 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