-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
38 lines (32 loc) · 943 Bytes
/
server.js
File metadata and controls
38 lines (32 loc) · 943 Bytes
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
37
38
/*
* Module dependencies
*/
var express = require('express')
/*, sass = require('node-sass')*/
, app = express()
, site = require('./routes/site')
, ajaxTesting = require('./routes/ajaxTesting');
/*function compile(str, path) {
return stylus(str)
.set('filename', path)
.use(nib())
}*/
app.locals.pretty = true;
app.set('views', __dirname + '/app/views/pages');
//console.log(app.get('views'));
app.set('view engine', 'jade')
app.use(express.logger('dev'))
app.use(express.bodyParser())
/* doesn't work!!! (%extend)
app.use(sass.middleware({
src: __dirname + '/public/stylesheets/sass', //where the sass files are
dest: __dirname + '/public', //where css should go
debug: true // obvious
}));
*/
app.use(express.static(__dirname + '/.tmp'))
app.use(express.static(__dirname + '/app/public'))
app.get('/', site.index)
app.get('/:page.html', site.page)
app.all('/ajax/:page', ajaxTesting.page)
app.listen(3000)