Comments (9)
Yup, every single issue is resolved! Behaves exactly like express. Thank you very much for your time! Very excited to try out websocket support too, very promising
from legacy.
Hello and big thanks for report and using nanoexpress.
I am firstly express user, then transited to fastify, so i am forgot polyfill a lot of methods and properties and i am very happy to see this library helpful to someone than me.
I am would be happy to fix these bugs, make tests to these issues. Are you able to test when fix?
Also, i am uses different solution for middleware than using like router for performance and better error handle reason.
Middleware will call if any of route was defined and calling. If no one defined, you can fix this by app.any(‘*’, () => {}). Express-like solution is best, that solution performance differs by 2x on medium-scale apps and reduces hosting cost by from 2 up to 25 times depending on your application code which is huge for startup projects and even for huge applications. I hope you understand why i used different solution than express.
About other like status or polyfill properties i will look tomorrow, today bit busy.
Thanks again
from legacy.
Yup, I will be able to test. That makes sense; it would be helpful to document it though. Thank you for your time!
from legacy.
I also just found one more issue that is particularly annoying as it doesn't appear to have a good workaround. req.method
is set to ANY
when using app.any(...). The d.t.s says you should use req.getMethod()
from uWebsockets.js for this method, however trying to use this method in app.any(...) will always hang because req
is deallocated by then (Using uWS.HttpRequest past its request handler return is forbidden (it is stack allocated).) because there is an await inbetween calling the user handler.
Sapper uses req.method to determine which module method (get, post, etc.) to call. When it's set to ANY
all server routes fail.
I've done req.method = "GET"
for now but this obviously won't work for post methods.
from legacy.
Hi @caresx
Please, can you test, issue is fixed in v0.12.15
or still exists?
from legacy.
@caresx
I am also added status
change example.
Updated docs related to these things
from legacy.
Hi @dalisoft!
A number of issues still exist, but req.originalUrl
is fixed now. Setting res.statusCode
(= 200 for example) still breaks the app with the same message but res.status
works now. req.method
is still ANY
for app.any routes and req.getMethod()
still crashes inside app.any
. The fix applied for req.baseUrl
is also not correct and I've had to set it to '' for now. req.baseUrl
is supposed to be used for subrouters however it's not very useful and I think always setting it to '' is fine (note that setting it to '/' caused mime errors for all my static .js files, so it really needs to be an empty string). Thanks for your time!
from legacy.
Hi @caresx
Can you test now?
Also i am did polyfill which should atomically call app.any()
even if you not define app.any()
after using app.use()
(can you test this functionality too?)
Thank you for your test and time :)
from legacy.
Thanks for report, test and help.
Happy to see users able to use this library
from legacy.
Related Issues (20)
- Using socket.io + nanoexpress on the same port? HOT 1
- 404 error sometimes HOT 1
- ws handler will parse invalid JSON strings without a try catch block causing server to crash on malformed inputs HOT 1
- UnhandledPromiseRejectionWarning and app.setValidationErrorHandler() HOT 4
- Warning! PRO and PRO (ESM) version will be moved to Private repository HOT 1
- Is handlebars supported in nanoexpress like expressjs? HOT 4
- User forum HOT 4
- JSON body HOT 4
- Enable CORS HOT 5
- Method signature inconsistency - setNotFoundHandler HOT 3
- How to log everything HOT 7
- Options method does not return any data HOT 9
- How to use subscribe publish HOT 2
- websocket parameter wrong interface HOT 4
- Not found handler not activated HOT 5
- [Bug] Throw in async routes doesnt work HOT 4
- Question: No CommonJS for the simple version? HOT 6
- nanoexpress CJS - End of Life date
- Problems when using the examples that include an schema as a middleware HOT 1
- Websocket App publish crashes HOT 15
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 legacy.