forked from wikiwave/WikiWave
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
36 lines (30 loc) · 1.12 KB
/
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
/* __ __.__ __ .__ __ __
/ \ / \__| | _|__/ \ / \_____ ___ __ ____
\ \/\/ / | |/ / \ \/\/ /\__ \\ \/ // __ \
\ /| | <| |\ / / __ \\ /\ ___/
\__/\ / |__|__|_ \__| \__/\ / (____ /\_/ \___ >
\/ \/ \/ \/ \/ */
var express = require('express')
, app = express.createServer()
, settings = require('./settings').getSettings()
, path = require('path')
;
// Configure Express
app.settings = settings;
app.configure(function() {
app.use('/public', express.static(path.join(__dirname, 'public')));
console.log(path.join(__dirname, 'public'));
// TODO:
app.set('view engine', 'jade');
app.set('views', path.join(__dirname, '/views'));
app.use(app.router);
// Values available to every template
app.locals({
title: settings.title || 'WikiWave'
});
});
// Add routes to router
require('./routes/base-routes').routes(app, settings);
require('./routes/article-routes').routes(app, settings);
// Start server
app.listen(process.env.PORT || 3000);