UNPKG

express-demo-web

Version:

A demo for an express webserver

19 lines (12 loc) 478 B
var express = require('express'); var app = express(); var oneDay = 86400000 app.get('/', function(req, res) { res.send('Hello World'); }); app.set('port', process.env.PORT || 3000); // Start listening for HTTP requests var server = app.listen(app.get('port'), function() { var host = server.address().address; var port = server.address().port; console.log('Example app listening at http://%s:%s\nPress ctrl^c to stop the app.', host, port); });