forked from mozilla/webmaker.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
25 lines (19 loc) · 737 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
var express = require( "express" ),
habitat = require( "habitat" ),
nunjucks = require( "nunjucks" ),
path = require( "path" );
habitat.load();
var app = express(),
env = new habitat();
nunjucksEnv = new nunjucks.Environment( new nunjucks.FileSystemLoader( path.join( __dirname + '/views' ))),
routes = require( "./routes" );
nunjucksEnv.express( app );
app.disable( "x-powered-by" );
app.use( express.logger());
app.use( express.compress());
app.use( express.static( path.join( __dirname + "/public" )));
app.use( app.router );
app.get( "/healthcheck", routes.api.healthcheck );
app.listen( env.get( "PORT" ), function() {
console.log( "Server listening ( http://localhost:%d )", env.get( "PORT" ));
});