-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathserver.js
42 lines (25 loc) · 914 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
const express = require('express'),
bodyParser = require('body-parser'),
firebase = require('firebase'),
path = require('path');
const config = require('./app/config/config');
const app = express();
const PORT = process.env.PORT || 1313;
firebase.initializeApp(config);
const routes = require('./app/controllers/routes/api-routes');
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
app.use(routes);
app.use(express.static("app/public"));
const exphbs = require('express-handlebars');
app.set('view engine', 'handlebars');
app.set("views", 'app/views');
app.engine('handlebars', exphbs({
extname:'handlebars',
defaultLayout:'main.handlebars',
layoutsDir: 'app/views/layouts',
partialsDir : 'app/views/partials'
}));
app.listen(PORT, () => {
console.log('App listening on PORT ' + PORT);
});