Pooya Parsa 2017-05-19 12:05:20 +04:30
parent 8b253712f0
commit 90fc778e81
2 changed files with 3 additions and 3 deletions

View File

@ -28,7 +28,7 @@ class Nuxt {
css: [], css: [],
modules: [], modules: [],
layouts: {}, layouts: {},
serverMiddlewares: [], serverMiddleware: [],
ErrorPage: null, ErrorPage: null,
cache: false, cache: false,
loading: { loading: {

View File

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