fixed merge conflicts
[henge/kiak.git] / strapp.js
1 /**
2 * @file Node entry and main driver
3 * @author Jordan Lavatai, Ken Grimes
4 * @version 0.0.1
5 * @license AGPL-3.0
6 * @copyright loljk 2017
7 * @summ ary HTTP(S) Router that uses the first directory in the requested URL
8 * as the route name
9 */
10 const opts = require('./opts.js')
11 const router = require('./router.js')
12
13 Object.keys(opts['bindings']).forEach((key) => {
14 router.createBind(key, opts['bindings'][key])
15 })
16
17 router.startHttpServer({
18 port: opts['port'],
19 skelFile: './skel.html',
20 clientJS: opts['client-js'],
21 hostJS: opts['host-js'],
22 httpdRoot: opts['file-dir'],
23 tls: {
24 certFile: opts['ca-cert'],
25 keyFile: opts['ca-key']
26 }
27 })