middleware ~> serverMiddleware

To avoid confuse between client and serverSide middlewares
This commit is contained in:
Pooya Parsa 2017-05-12 23:24:00 +04:30
parent 975e468388
commit be80f95278
3 changed files with 4 additions and 4 deletions

View File

@ -59,8 +59,8 @@ class Module {
})
}
addMiddleware (middleware) {
this.options.middlewares.push(middleware)
addServerMiddleware (middleware) {
this.options.serverMiddlewares.push(middleware)
}
extendBuild (fn) {

View File

@ -28,7 +28,7 @@ class Nuxt {
plugins: [],
css: [],
modules: [],
middlewares: [],
serverMiddlewares: [],
cache: false,
loading: {
color: 'black',

View File

@ -10,7 +10,7 @@ class Server {
this.app = connect()
this.server = http.createServer(this.app)
// Add Middlewares
this.nuxt.options.middlewares.forEach(m => {
this.nuxt.options.serverMiddlewares.forEach(m => {
if (m instanceof Function) {
this.app.use(m)
} else if (m && m.path && m.handler) {