Hi all, appreciate if someone can help me on the following two questions.
-
What would you suggest to create a case-insensitive routing in Cloudflare Workers? The existing template is case-sensitive. Only thing I could think of is to check path:
const url = new URL(request.url)
const path = url.pathname
and get path.toLowerCase() value. Do you think this makes sense? -
Another thing I was searching but could not find a reply is how can we distinguish whether a npm package can be used in a worker project? I know the packages that uses node api can not be imported, but what about non-node-api ones? In the tutorial, I see some of the packages can be used (like qr tutorial)
Thanks