fix: make options more compatibility

master
dead-horse 2019-08-19 11:54:41 +08:00
parent 1015cea41d
commit 287e589ac7
1 changed files with 4 additions and 3 deletions

View File

@ -44,13 +44,14 @@ module.exports = class Application extends Emitter {
*
*/
constructor(options = {}) {
constructor(options) {
super();
options = options || {};
this.proxy = options.proxy || false;
this.middleware = [];
this.subdomainOffset = options.subdomainOffset || 2;
this.env = options.env || process.env.NODE_ENV || 'development';
this.keys = options.keys || undefined;
if (options.keys) this.keys = options.keys;
this.middleware = [];
this.context = Object.create(context);
this.request = Object.create(request);
this.response = Object.create(response);