]>
git.r.bdr.sh - rbdr/lgtm/blob - index.js
cc5c3b9685c936539abb988627ce9396e4cd509c
3 const Config
= require('./config/config');
4 const Koa
= require('koa');
5 const KoaStatic
= require('koa-static');
6 const Nunjucks
= require('nunjucks');
7 const RecordFetcher
= require('./lib/record_fetcher');
11 internals
.run
= () => {
13 Nunjucks
.configure(Config
.templateDirectory
);
15 internals
.app
= Koa();
17 internals
.app
.use(KoaStatic(Config
.staticDirectory
));
19 const recordFetcher
= new RecordFetcher();
20 internals
.app
.use(function * () {
22 const record
= yield recordFetcher
.fetch();
23 const parsedTemplate
= Nunjucks
.render('index.html.njk', record
);
25 this.body
= parsedTemplate
;
30 console
.log(' +-----+');
31 console
.log(` | o o | - Listening Gladly, Try Me: ${Config.port}`);
32 console
.log(' +-----+');
33 console
.log(' +---------+');
34 console
.log(' /| [][] |\\');
35 console
.log(' || | |');
36 console
.log(' || | \\c');
37 console
.log(' ^+---------+');
39 internals
.app
.listen(Config
.port
);