More elaborate routing (e.g. match only ints, etc.)
For example, allow a way to check that :id in /blah/:id is an integer before matching the route.
cc @jsthomas @c-cube for interest.
dream-routes from @ulrikstrid adapts @anuragsoni's Routes to Dream:
let () =
Dream.run
@@ Dream.logger
@@ Dream_routes.routes Routes.[
empty @--> (fun _request ->
Dream.html "Good morning, world!");
s "echo" / int /? nil @--> (fun integer _request ->
Dream.html @@ Printf.sprintf "integer: %i" integer);
s "echo" / str /? nil @--> (fun word _request ->
Dream.html word);
]
@@ Dream.not_found
Would you like a PR to Community Projects section in README?
Note that dream-routes does not yet handle different methods and we might need to discuss a nice API for that.
@thangngoc89 I think the community projects is a list of vetted projects that are actually recommended. So I guess a issue to ask for inclusion is what should happen 🙂
I think after dream-routes supports methods, and after a bit of review, we can add it to the list.
See ulrikstrid/dream-routes#1