Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to define multiple middleware #1811

Closed
Saurabh29 opened this issue Feb 15, 2025 · 5 comments
Closed

Is it possible to define multiple middleware #1811

Saurabh29 opened this issue Feb 15, 2025 · 5 comments
Labels
question Further information is requested

Comments

@Saurabh29
Copy link

Saurabh29 commented Feb 15, 2025

With SolidStart 1.1 is it possible to define createMiddleware for each route separately.

@brenelz
Copy link
Contributor

brenelz commented Feb 15, 2025

As far as I know middleware runs on every route. You might be able to check the request for this information and do specific things if you want

@Saurabh29
Copy link
Author

Thanks @brenelz and I agree with you. However, for code prespective it would be cleaner if can define multiple middleware, in earlier release it was allowed to define.

@atilafassina atilafassina added the question Further information is requested label Feb 16, 2025
@peterhirn
Copy link

You can define multiple middlewares (eg. https://github.com/phi-ag/solid-pages/blob/main/src/middleware.ts#L100), but you have to implement checking the route path.

@Saurabh29
Copy link
Author

Thanks a lot @peterhirn

@peterhirn
Copy link

Glad I could help! If this is resolved for you, please close the issue. ☺️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants