-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathserver.js
More file actions
45 lines (27 loc) · 776 Bytes
/
Copy pathserver.js
File metadata and controls
45 lines (27 loc) · 776 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
39
40
41
42
43
const express = require('express');
const cons = require('consolidate');
const dust = require('dustjs-linkedin');
const PORT = 8012;
var app = express();
//access css files
app.use(express.static(__dirname + '/public'))
app.set('port',process.env.PORT || PORT);
//view engine as dust
app.engine('dust',cons.dust);
app.set('view engine','dust');
app.set('views',__dirname + '/views');
app.get('/',function(req,res){
res.render('index');
});
app.get('/link1',function(req,res){
res.render('link1');
});
app.get('/link2',function(req,res){
res.render('link2');
});
app.listen(PORT);
console.log(`Server running on http://localhost:${PORT}`);
exports.listenServer = function(PORT){
app.listen(PORT);
return `Server running on http://localhost:${PORT}`;
}