Eio HTTP server with static file serving and route handlers
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix merlint lint warnings: missing docs, doc style, test inclusion

Resolve E400 (missing documentation), E410 (bad doc style), E615
(missing test suite), and E616 (use failf) across the monorepo.
Also fix test_timing to reference Requests.Timing instead of
non-existent Http.Timing.

+36
+36
lib/respond.mli
··· 33 33 content_type:string -> 34 34 string -> 35 35 t 36 + (** [v ~status ~content_type body] builds a response with the given status 37 + code, content type, and body. *) 36 38 37 39 val json : string -> t 40 + (** [json body] returns a 200 response with content type [application/json]. 41 + *) 42 + 38 43 val text : string -> t 44 + (** [text body] returns a 200 response with content type [text/plain]. *) 45 + 39 46 val html : string -> t 47 + (** [html body] returns a 200 response with content type [text/html]. *) 48 + 40 49 val raw : status:int -> content_type:string -> string -> t 50 + (** [raw ~status ~content_type body] builds a response without optional 51 + headers. *) 52 + 41 53 val not_found : t 54 + (** A 404 Not Found response. *) 55 + 42 56 val bad_request : string -> t 57 + (** [bad_request msg] returns a 400 Bad Request response with [msg] as body. 58 + *) 59 + 43 60 val method_not_allowed : t 61 + (** A 405 Method Not Allowed response. *) 62 + 44 63 val internal_server_error : string -> t 64 + (** [internal_server_error msg] returns a 500 Internal Server Error response. 65 + *) 66 + 45 67 val redirect : string -> t 68 + (** [redirect url] returns a 302 Found response with a [Location] header. *) 46 69 end 47 70 48 71 (** {1 Routes} *) ··· 65 88 (** {1 Utilities} *) 66 89 67 90 val parse_url : string -> string * params 91 + 68 92 val normalize_path : string -> string 93 + (** [normalize_path path] resolves [.] and [..] segments and removes empty 94 + segments. *) 95 + 69 96 val status_line : int -> string 97 + (** [status_line code] returns the HTTP status line (e.g. ["200 OK"]). *) 98 + 70 99 val reason_phrase : int -> string 100 + (** [reason_phrase code] returns the standard HTTP reason phrase for [code]. *) 101 + 71 102 val generate_etag : size:int -> string 103 + (** [generate_etag ~size] produces a weak ETag string derived from the content 104 + size. *) 105 + 72 106 val match_route : route list -> string -> route option 107 + (** [match_route routes path] returns the first route whose path matches [path], 108 + or [None]. *) 73 109 74 110 (** {1 Running} *) 75 111