Closed RemyLespagnol closed 7 years ago
Oh sorry.... I don't look at the PR.
No worries! (PR is #2 for posterity) - I'm waiting on an update to merge that PR, but could use your opinion as a windows user - what's a reasonable default other than :
to indicate that the path is a parameter? I'd like to keep this library fairly opinionated and avoid too much configurability. If you and @jpbourgeon can agree on a prefix, I'm sure he'd be happy to update that PR and we can land windows support.
Fo the param pattern, on Windows I don't see any best practices for this kind of things.
On Windows, to echo an environment variable, we use %VAR%. Named a folder with % is authorized.
So maybe % or _ can be good.
Hi
@Themandunord : your opinion would be welcome on the PR too #2
I agree that % might be a good option on windows if I had to make an opinionated choice.
Resolved via #2 released in v0.4.0
Hi @jesseditson,
They are some issues on Windows.
First, create folder like
:params
it's not permitted by default on windows. And the second, it's that on Windows your router doesn't work !It's because of Windows' paths. It's like
\\foo\\bar
So when you haver.match(req.url)
, the regex doesn't work.on line 58 you can replace this :
route.path = '/' + path.relative(routesDir, routeFile).replace(extPattern, '')
by this :
So the regex is right and your router works :)
PS: I can't make a make pull request because of the folder's name in your test folder.