refactor into components

This commit is contained in:
Pooya Parsa 2017-06-11 18:47:36 +04:30
parent d3f66e132e
commit 13a4e71a83

View File

@ -11,14 +11,14 @@ class Server {
this.app = connect() this.app = connect()
this.server = http.createServer(this.app) this.server = http.createServer(this.app)
this.nuxt.ready() this.nuxt.ready()
.then(() => { .then(() => {
// Add Middleware // Add Middleware
this.nuxt.options.serverMiddleware.forEach(m => { this.options.serverMiddleware.forEach(m => {
this.useMiddleware(m) this.useMiddleware(m)
})
// Add default render middleware
this.useMiddleware(this.render.bind(this))
}) })
// Add default render middleware
this.useMiddleware(this.render.bind(this))
})
return this return this
} }