lwsjs / local-web-server

A lean, modular web server for rapid full-stack development.
MIT License
1.21k stars 85 forks source link

rewrite syntax reference #73

Closed mscalora closed 6 years ago

mscalora commented 6 years ago

Are there good docs somewhere for the rewrite syntax? I thought maybe koa-rewrite was being used but I couldn't find very much there either.

I'm trying to ignore url search parameters but not other suffixes.

/test.html -> /real.html doesn't match anything with search string like /test.html?q=test

/test.html?* -> /real.html lets anything through, like/test.htmlNOT

Is ? a meta character? I tried a few things to escape it but nothing I could think of worked.

75lb commented 6 years ago

have you tried here?

mscalora commented 6 years ago

Yes, I saw that, it appears to only brush the topic somewhat lightly. The question mark character appears to act in a special way but is not mentioned, nor is escaping meta characters. Is there any special support for search query parameters? Many systems have pseudo-regexp support so I was wondering if ? was affected by something like that.

75lb commented 6 years ago

did you click the "express routing syntax" link? https://expressjs.com/en/guide/routing.html

On 18 Sep 2017 00:38, "Mike" notifications@github.com wrote:

Yes, I saw that, it appears to only brush the topic somewhat lightly. The question mark character appears to act in a special way but is not mentioned, nor is escaping meta characters. Is there any special support for search query parameters? Many systems have pseudo-regexp support so I was wondering if ? was affected by something like that.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/lwsjs/local-web-server/issues/73#issuecomment-330102032, or mute the thread https://github.com/notifications/unsubscribe-auth/ABMK7JS3R_7sEuZNWjNpkM8-_CyfnFoFks5sja1_gaJpZM4PaSjO .

mscalora commented 6 years ago

No I didn't see that despite looking at that page at least three times. Sorry, thanks, just what I needed.

75lb commented 6 years ago

no worries.. it's a wiki, so you can edit things if you think something is not clear enough.