forked from ptcmariano/frontend-test
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
executable file
·36 lines (30 loc) · 729 Bytes
/
app.js
File metadata and controls
executable file
·36 lines (30 loc) · 729 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
var express = require("express"),
app = express(),
http = require("http"),
path = require("path"),
arguments = require("shell-arguments");
global.CONFIG = require("./config");
require("./routes")(app);
app.use(
"/static",
express.static(
path.join(__dirname, "public")
)
);
if (arguments.port && /\d/g.test(arguments.port)) {
CONFIG.PORT = arguments.port;
}
if (arguments.encoding) {
CONFIG.VIEW.ENCODING = arguments.encoding;
}
if (arguments.extension) {
CONFIG.VIEW.EXTENSION = arguments.extension;
}
http
.createServer(app)
.listen(
CONFIG.PORT,
function() {
console.log("Application running on port: " + CONFIG.PORT);
}
);