-
-
Notifications
You must be signed in to change notification settings - Fork 121
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
404 when passing more than 1 middleware to app.method #22
Comments
@creepinson once again I will need a reproducible demo :) |
Oof, I installed the latest version of @tinyhttp/app and got this on almost every page except for /profile.... / should at least be found here but its not anymore |
@creepinson interesting, there is some external module made by you. Could you please make a route-only demo that I can try? Also, body-parser doesn't work. See #25 |
@creepinson is it still relevant? |
I'm not sure if it is still relevant, so closing feel free to re-open if it persists |
Ok, well I'm still getting a 404 error and it seems to be with using multiple middlewares like so: My "test" middleware: async function test(req: Request, res: Response, next?: NextFunction) {
console.log(`req body: ${JSON.stringify(req.body)}`);
next!();
} Then I use it like so: app.post('/register', test, register); where the test middleware is supposed to be executed and then after it is called my register middleware in the rest of my code gets called. While it does execute the test middleware and prints out the request body, it then gives the following from the logger middleware: I will try and make a reproducable demo as well. |
Ok, I've managed to create a simple demo: https://github.com/creepinson/tinyhttp-example/blob/master/src/index.ts Incorrrect output from the demo:
which gives my 404 response back to the curl command. What should be logged:
and the response should be a json object that was specified in the code. |
I don't think I can reopen this issue manually, I think you have to do it for me because you are the one that closed the issue. |
@creepinson, OK reoping I won't be able to help ya for ~2 weeks so pls be patient :) |
Ok, I'm back here the issue comes from when there are more than 1 wares passed to will look into this very soon |
@creepinson should be fixed now, in this code: please check |
seems to be working with my small example :D |
Sooooo,
I am having a new issue: the first response gives an actual error/result (which is expected), but on the second request it responds with my 404 noMatchHandler.. It doesn't matteer what the url is on the second request, it just sends the 404 and then complains the headers are already sent.
The text was updated successfully, but these errors were encountered: