Open Viper-Bit opened 2 months ago
@kartikk221
Does Express.js support a similar format?
yes express.js exactly using path-to-regexp package https://github.com/expressjs/express/blob/6d084715ba6ca5301e9ac1efe4309e555973b364/lib/router/layer.js#L16-L50 and also in express.js doc https://expressjs.com/en/4x/api.html#router.METHOD
Is there a simpler function or methodlogy to parse and apply the regex from a path without having to depend on another library?
maybe using find-my-way, fastify using find-my-way for parsing routes. based on router-benchmark find-my-way is so much faster
I see, I will look into integrating this using native RegExp If possible for the best performance.
Sounds like a bad idea
hi @kartikk221, how about adding regexp in path (just path parameters or whole path) ? path parameter:
whole path example:
we can use https://github.com/pillarjs/path-to-regexp to convert path to regexp or checking for ( ) in
parse_path_parameters
after each recognized path parameter