mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 16:12:12 +00:00
middleware ~> serverMiddleware
To avoid confuse between client and serverSide middlewares
This commit is contained in:
parent
975e468388
commit
be80f95278
@ -59,8 +59,8 @@ class Module {
|
||||
})
|
||||
}
|
||||
|
||||
addMiddleware (middleware) {
|
||||
this.options.middlewares.push(middleware)
|
||||
addServerMiddleware (middleware) {
|
||||
this.options.serverMiddlewares.push(middleware)
|
||||
}
|
||||
|
||||
extendBuild (fn) {
|
||||
|
@ -28,7 +28,7 @@ class Nuxt {
|
||||
plugins: [],
|
||||
css: [],
|
||||
modules: [],
|
||||
middlewares: [],
|
||||
serverMiddlewares: [],
|
||||
cache: false,
|
||||
loading: {
|
||||
color: 'black',
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user