-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
38 lines (29 loc) · 927 Bytes
/
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
var express = require('express');
var app = express();
var path = require('path');
var favicon = require('serve-favicon');
var sassMiddleware = require('node-sass-middleware');
app.set('port', (process.env.PORT || 5000));
app.use(express.static(__dirname + '/public'));
app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
app.set('views', __dirname + '/views')
app.set('view engine', 'pug')
//SASS
app.use(
sassMiddleware({
src: __dirname + '/public/stylesheets',
dest: __dirname + '/public/stylesheets',
prefix: '/stylesheets',
debug: true // obvious
})
);
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'));
});