Closed ghost closed 4 years ago
I checked this method because i did think does like this, but not work like that.
The code i'm tested:
const { App } = require("uWebSockets.js"); const app = App(); app .any("/*", (res, req) => { console.log("req #1", req); // <-- this works like before req.foo = true; req.setYield(true); }) .get("/get/*", (res, req) => { console.log("req #2", req); // <-- excepted req.foo = true req.bar = true; req.setYield(true); }) .get("/get/user", (res, req) => { console.log("req #3", req); // <-- excepted req.foo = true and req.bar = true, but these does not exist res.end("done :)"); }); app.listen(4000, token => token && console.log("listens at 4000"));
Try go to localhost:4000/get/user and see. May i missing something?
localhost:4000/get/user
@dalisoft Did you found any solution??
@vimalmistry I used workaround at high-level with simulating middlewares layer before every route request
@dalisoft can you share sample code?
@vimalmistry Here snippet
I checked this method because i did think does like this, but not work like that.
The code i'm tested:
Try go to
localhost:4000/get/user
and see. May i missing something?