Skip to content

Instantly share code, notes, and snippets.

@vesic
Last active August 15, 2016 13:55
Show Gist options
  • Save vesic/1b39bbae34fbca4274018264d1c71502 to your computer and use it in GitHub Desktop.
Save vesic/1b39bbae34fbca4274018264d1c71502 to your computer and use it in GitHub Desktop.
Hello Express
'use strict';
var express = require('express');
var app = express();
app.set('port', process.env.PORT || 3333);
app.get('/', (req, res) => {
res.send('Hello World!');
});
app.use((req, res) => {
res.status(404).send('File not found!');
});
app.listen(app.get('port'), () => {
console.log(`Example app listening on port ${app.get('port')}!`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment