Skip to content

Commit

Permalink
Configurable port for nginx. Ubuntu upstart file for daemonizing the …
Browse files Browse the repository at this point in the history
…node server.
  • Loading branch information
onelapahead committed Sep 16, 2016
1 parent e77bb6c commit 7cc3a9b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
12 changes: 12 additions & 0 deletions app.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
description "Swiper Server"
author "Hayden Fuss <[email protected]>"

start on (filesystem and net-device-up IFACE=lo)
stop on runlevel [!2345]

respawn

env PORT=5000

chdir /root/swiper/
exec node server.js
6 changes: 3 additions & 3 deletions server.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var express = require('express'),
workers = require('./routes/workers'),
path = require('path');

var port = process.env.PORT || 3000;
var app = express();

app.use(express.static(path.join(__dirname, 'public')));
Expand All @@ -17,5 +17,5 @@ app.post('/workers', workers.addWorker);
app.put('/workers/:id', workers.updateWorker);
app.delete('/workers/:id', workers.deleteWorker);

app.listen(3000);
console.log('Listening on port 3000...');
app.listen(port);
console.log('Listening on port '+port+'...');

0 comments on commit 7cc3a9b

Please sign in to comment.