-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.js
71 lines (46 loc) · 1.25 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
* Module dependencies
*/
var express = require('express');
var app = express();
var sassMiddleware = require('node-sass-middleware');
var coffeeMiddleware = require('coffee-middleware');
app.set('port', (process.env.PORT || 5000));
app.use("/stylesheets", express.static(__dirname + '/views'));
//app.use("/scripts", express.static(__dirname + '/views'));
app.use(
express.static(__dirname + '/public')
)
app.use(
express.static(__dirname + '/views')
);
app.set('views', __dirname + '/views')
app.set('view engine', 'pug')
//app.use(express.logger('dev'))
//SASS
app.use(
sassMiddleware({
src: __dirname + '/public/stylesheets',
dest: __dirname + '/public/stylesheets',
prefix: '/stylesheets',
debug: true // obvious
})
);
//Coffee
app.use(
coffeeMiddleware({
src: __dirname, // where coffescripts are
dest: __dirname + '/views', // where js sould go
debug: true
})
);
app.get('/', function (req, res) {
res.render('index', { title : 'Home' }
)
});
app.get('/test', function (request, response) {
response.render('test', { title: 'test' });
});
app.listen(app.get('port'), function () {
console.log("Node app is running at localhost:" + app.get('port'));
});