Comments (12)
@creepinson, OK reoping
I won't be able to help ya for ~2 weeks so pls be patient :)
from tinyhttp.
Ok, I'm back here
the issue comes from when there are more than 1 wares passed to app.method
will look into this very soon
from tinyhttp.
@creepinson once again I will need a reproducible demo :)
from tinyhttp.
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
heres the code: https://hastebin.com/jaxefuqapo.coffeescript
from tinyhttp.
@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
from tinyhttp.
@creepinson is it still relevant?
from tinyhttp.
I'm not sure if it is still relevant, so closing
feel free to re-open if it persists
from tinyhttp.
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:
POST 404 Not Found /register
even though it just worked with the first test middleware.
I will try and make a reproducable demo as well.
from tinyhttp.
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:
Listening on :8080
Req url: "/test"
GET 404 Not Found /test
which gives my 404 response back to the curl command.
What should be logged:
Listening on :8080
Req url: "/test"
GET 200 OK /test
and the response should be a json object that was specified in the code.
from tinyhttp.
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.
from tinyhttp.
@creepinson should be fixed now, in this code:
please check
from tinyhttp.
seems to be working with my small example :D
I will also try my larger example but I think it might be fixed.
from tinyhttp.
Related Issues (20)
- Response object interface doesn't match @types/express behavior, it's not really generic HOT 6
- Simple Pull Request - License-none
- Failed to start https server HOT 1
- Multiple path arguments (as array) to route HOT 4
- Link CONTRIBUTING.md in README.md and mention forking as the first step instead of clone HOT 1
- Incompatible with Express middleware: `express.Handler` HOT 26
- Mounting a subapp on array of paths
- Add missing `accepts` TypeScript signatures HOT 4
- Mallformed URI's leads to crash with `/thing/:id` routes HOT 1
- app.use(<path>, <Router>) is Incompatible with Express HOT 8
- Exporting a router file is not working HOT 7
- Create a community server HOT 8
- The website is down HOT 7
- Request `.xhr` misses fetch requests (headers are lowercase) HOT 3
- req.route always returns undefined HOT 19
- Server instance (of `@tinyhttp/app`) hangs on test since 2.0.33 HOT 4
- Predefined error type HOT 4
- ZOD support / example HOT 6
- Wildcards strip the first character from `req.url` HOT 10
- [docs] outdated app.engine example with eta HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tinyhttp.