Skip to content

Instantly share code, notes, and snippets.

@philpoore
Created November 5, 2014 13:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philpoore/30d4993324d591586cee to your computer and use it in GitHub Desktop.
Save philpoore/30d4993324d591586cee to your computer and use it in GitHub Desktop.
Simple HTTP Server
var express = require('express');
var morgan = require('morgan');
var app = new express();
app
.use(morgan('common'))
.use(function (req,res){
res.end('hello world');
}).listen(process.env.PORT || 8080);
# install forever globally
npm install forever -g
# install packages
npm install express morgan
# start script as deamon
forever start server.js
# show log filename
forever logs
# use $filename for command
watcher ~/.forever/somefile.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment