-
Notifications
You must be signed in to change notification settings - Fork 8
/
server.js
49 lines (38 loc) · 841 Bytes
/
server.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
37
38
39
40
41
42
43
44
45
46
47
48
'use strict';
var express = require('express');
var stormpath = require('express-stormpath');
var routes = require('./lib/routes');
/**
* Create the Express application.
*/
var app = express();
/**
* Application settings.
*/
app.set('trust proxy',true);
app.set('view engine', 'jade');
app.set('views', './lib/views');
app.locals.siteName = 'Express-Stormpath Example Project';
/**
* Stormpath initialization.
*/
console.log('Initializing Stormpath');
app.use(stormpath.init(app, {
expand: {
customData: true
}
}));
/**
* Route initialization.
*/
app.use('/', routes);
app.on('stormpath.ready',function () {
console.log('Stormpath Ready');
});
/**
* Start the web server.
*/
var port = process.env.PORT || 3000;
app.listen(port, function () {
console.log('Server listening on http://localhost:' + port);
});