Skip to content

Instantly share code, notes, and snippets.

@awareness481
Created August 25, 2018 12:56
Show Gist options
  • Save awareness481/bbdba6a307d2c85315a59fea54902ad8 to your computer and use it in GitHub Desktop.
Save awareness481/bbdba6a307d2c85315a59fea54902ad8 to your computer and use it in GitHub Desktop.
const express = require('express');
const http = require('http');
const path = require('path');
const routes = require('./routes');
const app = express();
const server = http.createServer(app);
// view engine
app.set('views', path.join(__dirname, './views'));
app.set('view engine', 'pug');
app.use('/', routes);
app.use(express.static(path.join(__dirname, './public')));
server.listen(3000);
server.on('listening', () => {
console.log('Server initialized at 3000');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment