Skip to content

Instantly share code, notes, and snippets.

@oldaccountarchived
Last active June 2, 2016 15:52
Show Gist options
  • Save oldaccountarchived/9debca04a88dc8f3c0b5 to your computer and use it in GitHub Desktop.
Save oldaccountarchived/9debca04a88dc8f3c0b5 to your computer and use it in GitHub Desktop.
'use strict';
let express = require('express');
let bodyParser = require('body-parser');
let path = require('path');
let app = express();
let publicDir = '/public';
let port = 8080;
app.use(bodyParser.json());
app.use(express.static(publicDir));
app.get('/', function(req, res) {
res.sendFile(path.join(__dirname, 'index.html'));
});
app.listen(port);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment