Created
November 5, 2014 13:07
-
-
Save philpoore/30d4993324d591586cee to your computer and use it in GitHub Desktop.
Simple HTTP Server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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