Comments (2)
Hey, there currently isn't support for that specific syntax since hyper-express
for the most part, passes the path straight to uWS.js which has a fast router for working with path parameters. This can certainly be implemented in the future as a breaking change during a major version upgrade.
With that said, what you are trying to achieve can be done with wildcards like so:
router.get('/get-message/*', (request: Request, response: Response) => {
// When splitting the path by slashes, the first item will be "get-message", second and third would be the optional params
const [_, session_id, timestamp_before] = request.path.split('/');
});
Keep in mind, wildcard routes effectively listen for all subpaths on the wildcard, so you should bind the wildcard route last.
So the above example would handle all requests whose paths begin with "/get-message/....." so be mindful of that.
from hyper-express.
Thanks @kartikk221, I will consider that solution for now.
from hyper-express.
Related Issues (20)
- HyperExpress faster then uWebsockets HOT 2
- file (sendFile) without caching HOT 3
- SSE not working as expected HOT 4
- Issue in setting an API gateway HOT 3
- Important middleware (express-rate-limit) support needed. HOT 3
- How to enable cors in hyper-extress HOT 7
- Implement custom global error middleware HOT 1
- Error: Cannot find module './uws_linux_x64_127.node' in Node 22 HOT 2
- piping crash in 6.16.1 HOT 3
- SSEventStream - EventSource's response has a MIME type ("text/plain") that is not "text/event-stream" HOT 2
- crashes when using it with pkg HOT 1
- can't serve port 80 hyper-express reverse proxy nginx HOT 1
- Error: HyperExpress: Server/Router.use() -> Wildcard "*" & ":parameter" prefixed paths are not allowed when binding middlewares or routers using this method. HOT 1
- Throwing error in Middleware causes app to crash HOT 4
- How to read base64 image from multipart HOT 1
- Specify QoS for MQTT syntax HOT 2
- Install hyper-express with PNPM behind a corporate firewall HOT 1
- middleware not executing after request is complete HOT 2
- Path parameter regexp
- How to integrate with supertest HOT 1
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 hyper-express.