-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.js
40 lines (28 loc) · 944 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
37
38
39
40
// Include the required modules
var express = require('express'),
app = express(),
routes = require('./routes');
// Configure the application
app.configure(function() {
// Enable the bodyParser so we can access POST data
app.use(express.bodyParser());
// Enable the cookieParser so we can work with cookies
app.use(express.cookieParser('super-duper-secret'));
// add req.session cookie support
app.use(express.cookieSession());
// Enable the logging
app.use(express.logger('dev'));
// Set the path to the public directory
app.use(express.static(__dirname + '/public'));
// Set the views directory
app.set('views', __dirname + '/views');
// Set the view engine
app.set('view engine', 'jade');
});
// Page routes
app.get('/', routes.index);
app.get('/print', routes.print);
// Let the app listen op port 1337
app.listen(1337);
// Set the console message
console.log('Application accessible at http://localhost:1337');