Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

Middleware is being executed for static files #58

Open
stas-sl opened this issue Aug 1, 2017 · 1 comment
Open

Middleware is being executed for static files #58

stas-sl opened this issue Aug 1, 2017 · 1 comment

Comments

@stas-sl
Copy link

stas-sl commented Aug 1, 2017

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)
@jbreuer95
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants