hoewerkt/app.js

30 lines
849 B
JavaScript
Raw Normal View History

2015-06-24 12:30:43 +02:00
//web.js
var express = require('express');
var less = require('express-less');
var hoewerkt = require('./hoewerkt');
var fs = require('fs');
2015-06-24 12:30:43 +02:00
var app = express();
//Set up jade rendering engine.
app.set('view engine', 'jade');
app.disable('view cache');
app.set('views', __dirname + '/resources/jade');
//Set up all static directories for getting resources.
app.use('/css', less(__dirname + '/resources/less', {debug : true}));
2015-06-24 12:30:43 +02:00
// app.use('/js', express.static(__dirname + '/resources/js'));
app.use('/images', express.static(__dirname + '/resources/images'));
app.use('/other', express.static(__dirname + '/resources/other'));
//Setup markdown middleware.
2015-06-24 12:30:43 +02:00
app.get('/', hoewerkt);
app.get('/:article', hoewerkt);
2015-06-24 12:30:43 +02:00
function start(port, host) {
app.listen(port, host);
}
module.exports = start;
if (process.argv[2] == 'standalone') start(1024);