Skip to content

Commit

Permalink
fix: new app will be correctly generated
Browse files Browse the repository at this point in the history
  • Loading branch information
gerard2perez committed Sep 18, 2017
1 parent 1779e8b commit fba7774
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
1 change: 1 addition & 0 deletions src/commands/new.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const setupConfig = async function setupConfig (app) {
utils.render(TemplatePath('config/inflections.js'), Project('config/inflections.js'));
utils.render(TemplatePath('config/security.js'), Project('config/security.js'));
utils.render(TemplatePath('config/server.js'), Project('config/server.js'), {
name: application,
key: `'${(await secret(48)).toString('hex')}'`
});
utils.render(TemplatePath('config/static.js'), Project('config/static.js'));
Expand Down
8 changes: 4 additions & 4 deletions src/functions/nginx.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ export async function buildNginx () {
}

nginxConf = compile(nginxConf, {
hostname: scfg.host,
port: scfg.port,
hostname: configuration.server.host,
port: configuration.server.port,
protocol: listen ? 'https' : 'http'
});
let childsubdomains = glob('koaton_modules/**/config/server.js').map((c) => {
Expand All @@ -63,8 +63,8 @@ export async function buildNginx () {
for (const idx in allsubdomains) {
nginxConf += compile(serverTemplate, {
subdomain: allsubdomains[idx],
hostname: scfg.host,
port: scfg.port,
hostname: configuration.server.host,
port: configuration.server.port,
listen: listen || 'listen 80',
client_max_body_size: (configuration.server.client_max_body_size || '1M'),
protocol: listen ? 'https' : 'http'
Expand Down
6 changes: 3 additions & 3 deletions templates/app.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
'use strict';

const koaton = require('koaton');
const koaton = require('koaton').default;

koaton.use(koaton.localization);
koaton.use(koaton.detectsubdomain);
koaton.use(koaton.conditional);
koaton.use(koaton.cached);
koaton.use(koaton.helmet);
koaton.use(koaton.bodyparser);
koaton.use(koaton.jsurl);
Expand All @@ -13,6 +12,7 @@ koaton.use(koaton.session(koaton));
koaton.use(koaton.passport.initialize());
koaton.use(koaton.passport.session());
koaton.use(koaton.oAuth2Server);
koaton.use(koaton.i18nHelper);
koaton.use(koaton.views);
koaton.use(koaton.subdomainrouter);
// ============================================
Expand Down
9 changes: 4 additions & 5 deletions templates/config/server.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
'use strict';

exports.default = {
name: 'koaton',
name: '{{name}}',
client_max_body_size: '1M',
bodyParser: {
formLimit: '1mb'
},
hhtps: {
https: {
dev: {
key: undefined,
cert: undefined
Expand All @@ -25,8 +25,7 @@ exports.default = {
serchTerm: 'search'
},
subdomains: [
'www',
'origin'
'www'
],
host: {
dev: 'localhost',
Expand All @@ -38,7 +37,7 @@ exports.default = {
error: {
layout: 'error.handlebars',
data: {
support_email: 'gerard2perez@outlook.com',
support_email: 'support@{{name}}.com',
description: 'Oops! - looks like something went completely wrong.'
}
},
Expand Down

0 comments on commit fba7774

Please sign in to comment.