-
Notifications
You must be signed in to change notification settings - Fork 0
/
web.js
32 lines (28 loc) · 800 Bytes
/
web.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
var express = require("express"),
stylus = require("stylus"),
router = require("./router"),
app = express();
app.configure(function() {
app.use(express.logger());
app.use(express.bodyParser());
// templating settings
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
app.set('view options', {layout: true});
// stylesheet compilation
app.use(stylus.middleware({
src: __dirname + '/assets',
dest: __dirname + '/public',
compile: function(str, path) {
return stylus(str)
.set('filename', path)
.set('compress', true);
}
}));
app.use(express.static(__dirname + '/public'));
});
router.initRoutes(app);
var port = process.env.PORT || 5000;
app.listen(port, function() {
console.log("Listening on " + port);
});