Skip to content

Instantly share code, notes, and snippets.

@marufsiddiqui
Forked from zachariahtimothy/apiServer.js
Created July 2, 2013 18:44
Show Gist options
  • Save marufsiddiqui/5911938 to your computer and use it in GitHub Desktop.
Save marufsiddiqui/5911938 to your computer and use it in GitHub Desktop.
/**
* Module dependencies.
*/
var express = require('express');
var http = require('http');
var app = express();
// all environments
app.use(express.favicon());
app.use(express.logger('dev'));
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(express.cookieParser('your secret here'));
app.use(express.cookieSession({secret: 'cool cat', maxAge: 60 * 60 * 1000}));
app.use(app.router);
// development only
if ('development' === app.get('env')) {
app.use(express.errorHandler());
}
app.get('/', function (req, res) {
res.sendfile('app/index.html');
});
require('./routes')(app);
exports = module.exports = http.createServer(app);
exports.use = function() {
app.use.apply(app, arguments);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment