Comparing version 1.5.2 to 1.6.0
@@ -50,3 +50,3 @@ 'use strict'; | ||
if (typeof path === 'object') { | ||
this.config = path; | ||
this.config = _lodash2.default.defaultsDeep(path, this.defaultConfig); | ||
} | ||
@@ -53,0 +53,0 @@ |
@@ -13,4 +13,2 @@ 'use strict'; | ||
var _path = require('path'); | ||
var _koa = require('koa'); | ||
@@ -82,11 +80,9 @@ | ||
_setupConfig(config) { | ||
let loader = new _config2.default(); | ||
(0, _kratosConfig.setInstance)(loader.load(config)); | ||
module.parent.paths.push((0, _path.join)((0, _path.dirname)(__dirname), '..', 'node_modules')); | ||
_kratosConfig2.default.instance = new _config2.default().load(config); | ||
} | ||
_setupApp() { | ||
this.name = (0, _kratosConfig2.default)('app.name'); | ||
this.proxy = (0, _kratosConfig2.default)('app.proxy'); | ||
this.subdomainOffset = (0, _kratosConfig2.default)('app.subdomainOffset'); | ||
this.name = _kratosConfig2.default.get('app.name'); | ||
this.proxy = _kratosConfig2.default.get('app.proxy'); | ||
this.subdomainOffset = _kratosConfig2.default.get('app.subdomainOffset'); | ||
} | ||
@@ -130,5 +126,5 @@ | ||
run(port) { | ||
port = port || (0, _kratosConfig2.default)('app.port'); | ||
port = port || _kratosConfig2.default.get('app.port'); | ||
_http2.default.createServer(this.callback()).listen(port, '0.0.0.0', () => { | ||
console.log(`${ (0, _kratosConfig2.default)('app.name') } started on http://0.0.0.0:${ port } in ${ this.env } mode.`); | ||
console.log(`${ _kratosConfig2.default.get('app.name') } started on http://0.0.0.0:${ port } in ${ this.env } mode.`); | ||
}); | ||
@@ -135,0 +131,0 @@ } |
{ | ||
"name": "kratos", | ||
"version": "1.5.2", | ||
"version": "1.6.0", | ||
"description": "Powerful full stack framework using the strength of the JavaScript ecosystem", | ||
@@ -16,3 +16,4 @@ "homepage": "https://github.com/kratos/kratos", | ||
"prebuild": "npm run clean -s", | ||
"build": "babel --optional=runtime --whitelist=es6.modules,strict -d dist src", | ||
"build": "babel src --optional=runtime --whitelist=es6.modules,strict --out-dir dist", | ||
"develop": "npm run build -- --watch", | ||
"patch": "npm version patch && npm publish", | ||
@@ -59,4 +60,4 @@ "minor": "npm version minor && npm publish", | ||
"koa-mount": "1.3.0", | ||
"kratos-config": "1.1.1", | ||
"kratos-router": "1.3.0", | ||
"kratos-config": "1.2.0", | ||
"kratos-router": "1.3.1", | ||
"lodash": "3.10.1", | ||
@@ -63,0 +64,0 @@ "process-env": "0.0.1" |
9756
179
+ Addedkratos-config@1.2.0(transitive)
+ Addedkratos-router@1.3.1(transitive)
- Removedkratos-config@1.1.1(transitive)
- Removedkratos-router@1.3.0(transitive)
Updatedkratos-config@1.2.0
Updatedkratos-router@1.3.1