Skip to content

Instantly share code, notes, and snippets.

@kutsaniuk

kutsaniuk/app-server.js

Last active Oct 20, 2017
Embed
What would you like to do?
var express = require('express');
var bodyParser = require('body-parser');
var app = express();
app.set('port', process.env.PORT || 3000)
app.use(express.static(__dirname))
app.use(bodyParser.json())
var http = require('http').Server(app)
// Route
app.get('/', (req, res) => {
res.sendFile(__dirname + '/index.html');
})
http.listen(app.get('port'), () => {
console.log('Conference App listening on ' + app.get('port'))
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment