-
Notifications
You must be signed in to change notification settings - Fork 11
/
app.js
36 lines (29 loc) · 986 Bytes
/
app.js
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
// ***************************************
// * *
// * EasyCTF 2014 CTF-Platform *
// * *
// ***************************************
var express = require("express");
var http = require("http");
var api = require("./api/api");
var router = require("./app/router");
require("dotenv").load();
var app = express();
app.configure(function() {
app.set("port", process.env.PORT || 3000);
app.set("views", __dirname + "/app/jade");
app.set("view engine", "jade");
app.locals.pretty = true;
app.use(express.bodyParser());
app.use(express.cookieParser());
app.use(express.methodOverride());
app.use(express.session({
secret: process.env.APP_SECRET
}));
app.use(express.static(__dirname + "/web"));
});
api(app);
router(app);
http.createServer(app).listen(app.get("port"), function() {
console.log("[app.js] listening on port " + app.get("port") + "...");
});