-
Notifications
You must be signed in to change notification settings - Fork 71
Open
Description
Given a modified version of the README example:
open Opium.Std
let print_param = get "/hello/:name" begin fun req ->
`String ("Hello " ^ param req "name") |> respond'
end
let print_other = get "**" begin fun req ->
`String "Hello everyone else" |> respond'
end
let () =
App.empty
(* Order matters! *)
|> print_other
|> print_param
(* Order matters! *)
|> App.run_commandWith this code I see "Hello test" if I GET /hello/test and "Hello everyone else" if I use other paths. However, if I swap the lines between the comments above then the only response "Hello everyone else". OCaml 4.02.3 + opium 0.13.3 + cohttp 0.19.3 from opam.
I'm not sure what the right approach is here. It's useful to be able to have specific routes with an catch-all to handle all other requests. It would be useful if the right way to do this were shown in the README or somewhere similarly visible.
Metadata
Metadata
Assignees
Labels
No labels