-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
37 lines (33 loc) · 958 Bytes
/
Copy pathserver.js
File metadata and controls
37 lines (33 loc) · 958 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
'use strict';
require('app-module-path').addPath(__dirname);
const dotenv = require('dotenv');
dotenv.config();
const Hoek = require('hoek');
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();