-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
38 lines (34 loc) · 945 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
/*
* @package Drop-Tweets-Not-Bombs
* @author <[email protected]>
*/
var express = require( 'express' ),
app = express(),
environment = app.get( 'env' );
app.configure( function () {
// Set the application title.
app.set( 'title', 'Drop Tweets not Bombs' );
app.engine( 'jade', require( 'jade' ).__express );
// Set the error handling capabilities.
if( 'development' === environment ) {
app.use( express.errorHandler( {
dumpExceptions: true,
showStack: true
} ) );
}
if( 'production' === environment ) {
app.use( express.errorHandler() );
}
} );
app.get( '/', function ( request, response ) {
// var body = app.get( 'title' );
// response.setHeader( 'Content-Type', 'text/plain' );
// response.setHeader( 'Content-Length', body.length );
// response.end( body );
response.render( 'index.jade', {
title: 'Home',
pageName: 'index'
} )
} );
app.listen( 8888 );
console.log( 'Listening on port 8888' );