-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathserver.js
More file actions
34 lines (30 loc) · 746 Bytes
/
server.js
File metadata and controls
34 lines (30 loc) · 746 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
'use strict';
const dotenv = require('dotenv')
dotenv.config()
const Manifest = require('./config/manifest');
const Glue = require('glue');
const Handlebars = require('handlebars');
const composeOptions = {
relativeTo: __dirname
};
async function startServer () {
try {
var server = await Glue.compose(Manifest.get('/'), composeOptions);
server.views({
engines: {
hbs: Handlebars
},
path: './app/templates',
layoutPath: './app/templates/layouts',
helpersPath: './app/templates/helpers',
partialsPath: './app/templates/partials',
layout: 'default'
});
await server.start();
console.info(`Server started at ${server.info.uri}`);
} catch (err) {
console.error(err);
process.exit(1);
}
}
startServer();