-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
51 lines (44 loc) · 1010 Bytes
/
index.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
var express = require('express');
var exphbs = require('express-handlebars')
var path = require('path')
var app = express();
app.set('views', path.join(__dirname, 'views'));
app.engine('hbs', exphbs({ extname: 'hbs', defaultLayout: 'main' }));
app.set('view engine', 'hbs');
app.set('port', process.env.PORT || 3000);
app.use(express.static('public'))
var jars = [
{
name: 'Necessity account',
value: 55
},
{
name: 'Financial freedom account',
value: 10
},
{
name: 'Education account',
value: 10
},
{
name: 'Long-term saving for spending account',
value: 10
},
{
name: 'Play account',
value: 10
},
{
name: 'Give Account',
value: 10
},
];
app.get('/', function (req, res) {
res.render('home', {
content: 'some contents',
jars: jars
})
});
app.listen(app.get('port'), function () {
console.log('Express server start on PORT 3000')
})