@@ -1973,7 +1973,6 @@ val run :
19731973 ?stop : unit promise ->
19741974 ?debug : bool ->
19751975 ?error_handler : error_handler ->
1976- ?prefix : string ->
19771976 ?https : bool ->
19781977 ?certificate_file : string ->
19791978 ?key_file : string ->
@@ -2004,8 +2003,6 @@ val run :
20042003 low-level errors. See {!section-errors} and example
20052004 {{:https://github.com/aantron/dream/tree/master/example/9-error#files}
20062005 [9-error]} \[{{:http://dream.as/9-error} playground}\].
2007- - [~prefix] is a site prefix for applications that are not running at the
2008- root ([/]) of their domain. The default is ["/"], for no prefix.
20092006 - [~https:true] enables HTTPS. You should also specify [~certificate_file]
20102007 and [~key_file]. However, for development, Dream includes an insecure
20112008 compiled-in
@@ -2036,7 +2033,6 @@ val serve :
20362033 ?stop : unit promise ->
20372034 ?debug : bool ->
20382035 ?error_handler : error_handler ->
2039- ?prefix : string ->
20402036 ?https : bool ->
20412037 ?certificate_file : string ->
20422038 ?key_file : string ->
@@ -2071,7 +2067,6 @@ val serve :
20712067 @@ Dream.lowercase_headers
20722068 @@ Dream.content_length
20732069 @@ Dream.catch_errors
2074- @@ Dream.chop_site_prefix
20752070 @@ my_app
20762071 ]}
20772072
@@ -2098,10 +2093,15 @@ val catch_errors : middleware
20982093(* * Forwards exceptions, rejections, and [4xx], [5xx] responses from the
20992094 application to the error handler. See {!section-errors}. *)
21002095
2101- val chop_site_prefix : middleware
2102- (* * Removes {!Dream.run} [~prefix] from the path in each request, and adds it to
2103- the request prefix. Responds with [502 Bad Gateway] if the path does not
2104- have the expected prefix. *)
2096+ val with_site_prefix : string -> middleware
2097+ (* * Removes the given prefix from the path in each request, and adds it to the
2098+ request prefix. Responds with [502 Bad Gateway] if the path does not have
2099+ the expected prefix.
2100+
2101+ This is for applications that are not running at the root ([/]) of their
2102+ domain. The default is ["/"], for no prefix. After [with_site_prefix],
2103+ routing is done relative to the prefix, and the prefix is also necessary for
2104+ emitting secure cookies. *)
21052105
21062106
21072107
0 commit comments