Skip to content

Instantly share code, notes, and snippets.

@evanxg852000
Created December 7, 2018 12:03
Show Gist options
  • Save evanxg852000/73c7b19f1b326acbc9862564db33d850 to your computer and use it in GitHub Desktop.
Save evanxg852000/73c7b19f1b326acbc9862564db33d850 to your computer and use it in GitHub Desktop.
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