cloudflare / worker-template-router

231 stars 84 forks source link

What about route params? #23

Closed PierBover closed 3 years ago

PierBover commented 4 years ago

For example something like: /users/:userId

nikhiljohn10 commented 4 years ago

@PierBover I have been working on it and finally finished it. But I am not able to PR here anything as it seems like this repo is dead. Feel free to check out the API template. It is just advanced model of router template.

PierBover commented 4 years ago

Thanks @nikhiljohn10 I ended up making my own router.

Check: https://gist.github.com/PierBover/4da745b601d30a6bb850c297b0c0c579

This is not the final router I'm using but it has route matching and parameters.

nikhiljohn10 commented 4 years ago

Thanks @nikhiljohn10 I ended up making my own router.

Check: https://gist.github.com/PierBover/4da745b601d30a6bb850c297b0c0c579

This is not the final router I'm using but it has route matching and parameters.

It looks very nice. But if you are a fan of MVC, check api template.

simplenotezy commented 3 years ago

@nikhiljohn10 Did you by chance also mitigate this issue in your repo? https://github.com/cloudflare/worker-template-router/issues/33

kristianfreeman commented 3 years ago

This should be supported via #35