4 const Promise
= require('bluebird');
5 const express
= require('express');
6 const fs
= require('fs-extra');
7 const outputFile
= Promise
.promisify(fs
.outputFile
);
8 const expressHbs
= require('express-hbs');
9 const resolveStatic
= require('../server/web/resolve-static');
10 require('../server/web/register-helpers')(expressHbs
);
11 const shutdown
= require('shutdown');
13 var opts
= require('yargs')
25 .alias('help', 'h').argv
;
28 console
.error('Unable to render', err
);
32 const app
= express();
37 partialsDir
: resolveStatic('/templates/partials'),
38 onCompile: function(exhbs
, source
) {
39 return exhbs
.handlebars
.compile(source
, { preventIndent
: true });
41 layoutsDir
: resolveStatic('/layouts'),
42 contentHelperName
: 'content'
46 app
.set('view engine', 'hbs');
47 app
.set('views', resolveStatic('/templates'));
50 'mobile/native-embedded-chat-app',
52 isAndroidBuild
: opts
.android
59 outputFile(opts
.output
, html
, { encoding
: 'utf8' })
62 shutdown
.shutdownGracefully();