Created
December 7, 2018 12:03
-
-
Save evanxg852000/73c7b19f1b326acbc9862564db33d850 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
constructor(config = {}){ | |
const defaultConfig = { | |
env: 'dev', | |
port: 3000, | |
templates: './templates' | |
} | |
this.config = Object.assign(defaultConfig, config) | |
this._httpServer = http.createServer(this._handleRequest.bind(this)) | |
this.router = new Router() | |
this.templater = new Templater( | |
this.config.templates, | |
this.config.env.toLowerCase().startsWith('prod') | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment