mirror of
https://github.com/jimeh/heartb.it.git
synced 2026-02-19 12:56:47 +00:00
initial import
This commit is contained in:
36
app.js
Normal file
36
app.js
Normal file
@@ -0,0 +1,36 @@
|
||||
(function() {
|
||||
var app, express;
|
||||
|
||||
express = require('express');
|
||||
|
||||
app = module.exports = express.createServer();
|
||||
|
||||
app.configure(function() {
|
||||
app.set('views', __dirname + '/views');
|
||||
app.set('view engine', 'coffee');
|
||||
app.register('.coffee', require('coffeekup').adapters.express);
|
||||
app.use(express.bodyParser());
|
||||
app.use(express.methodOverride());
|
||||
return app.use(express.static(__dirname + '/public'));
|
||||
});
|
||||
|
||||
app.configure('development', function() {
|
||||
return app.use(express.errorHandler({
|
||||
dumpExceptions: true,
|
||||
showStack: true
|
||||
}));
|
||||
});
|
||||
|
||||
app.configure('production', function() {
|
||||
return app.use(express.errorHandler);
|
||||
});
|
||||
|
||||
app.get('/', function(req, res) {
|
||||
return res.render('index');
|
||||
});
|
||||
|
||||
app.listen(3000);
|
||||
|
||||
console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env);
|
||||
|
||||
}).call(this);
|
||||
Reference in New Issue
Block a user