-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathserver.js
54 lines (37 loc) · 957 Bytes
/
server.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
var express = require('express');
var app = express();
var exphbs = require('express-handlebars');
var hbs = require('hbs');
app.engine('handlebars',
exphbs({defaultLayout: 'main'}));
app.set('view engine', 'handlebars');
app.get('/', function(req, res){
res.render('index')
});
app.get('/film', function(req, res){
var user = {};
res.render('film')
});
app.get('/theater', function(req, res){
var user = {};
res.render('theater', user)
});
app.get('/music', function(req, res){
var user = {}
res.render('music', user)
});
app.get('/code', function(req, res){
var user = {};
res.render('code', user)
});
app.get('/about', function(req, res){
var user = {};
res.render('about',user)
});
app.use('/public', express.static('public'));
hbs.registerPartials(__dirname + '/views/partials');
// test
var port = Number(process.env.PORT || 8080);
app.listen(port, function(){
console.log('Hi There! Head over to port 8080 :)')
});