adonuxt-template icon indicating copy to clipboard operation
adonuxt-template copied to clipboard

Middleware is being executed for static files

Open stas-sl opened this issue 6 years ago • 1 comments

There are several middleware in config which is running on every request including nuxt bundles and images (can be ~50-100 per page)

const globalMiddleware = [
  'Adonis/Middleware/Cors',
  'Adonis/Middleware/BodyParser',
  'Adonis/Middleware/Shield',
  'Adonis/Middleware/Flash',
  'Adonis/Middleware/AuthInit'
]

Adonis has support for serving static files (by default from /public folder) but Nuxt doesn't seem to produce static files on disk anywhere in dev mode to be able to configure Adonis to serve static files from there.

This question is available on Nuxt.js community (#c46)

stas-sl avatar Aug 01 '17 12:08 stas-sl

you can configure nginx to point all images,css etc in /_nuxt/ to go to resources/_nuxt/ this way those assets will never be handled served adonis/nuxt. Let me know if you get this too work, if not i can do a test

jbreuer95 avatar Feb 09 '18 21:02 jbreuer95