blob: 94c5b9c68d5013221ab963fd55c35b65ad8e1fe4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
// Create express HTTP server app
var express = require('express');
var app = express();
var bodyParser = require('body-parser');
app.use(bodyParser.json());
app.use(express.static("."));
// defaults
var PORT = 4000;
// grap the command line arguments
var args = process.argv.slice(2);
if ( args[0] ) {
PORT = args[0];
}
app.listen(PORT);
console.log('Running on http://localhost:' + PORT);
|