You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't seem to understand how inline middlewares work.
Say i have an endpoint /test and i want to respond on it regardless if there is a trailing slash or not.
The following example works as expected:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I don't seem to understand how inline middlewares work.
Say i have an endpoint
/test
and i want to respond on it regardless if there is a trailing slash or not.The following example works as expected:
I get the expected answer on both
/test
and/test/
.Now i change it slightly to use an inline middleware for that same endpoint. I would expect everything to work the same:
Now accessing
/test
will work, but/test/
with a trailing slash results in a 404.I don't really seem to understand how inline middlewares work and what the difference is compared to a "normal" middleware.
Beta Was this translation helpful? Give feedback.
All reactions