improve docs and opam, tidy up for 0.1

This commit is contained in:
Simon Cruanes 2019-11-18 23:06:38 -06:00
parent 8bfcf3673a
commit f548041263
3 changed files with 6 additions and 3 deletions

View file

@ -11,12 +11,14 @@
features by declaring a few endpoints, including one for uploading files: features by declaring a few endpoints, including one for uploading files:
{[ {[
module S = Tiny_httpd
let () = let () =
let server = S.create () in let server = S.create () in
(* say hello *) (* say hello *)
S.add_path_handler ~meth:`GET server S.add_path_handler ~meth:`GET server
"/hello/%s@/" (fun name _req -> S.Response.make_string (Ok ("hello " ^name ^"!\n"))); "/hello/%s@/" (fun name _req ->
S.Response.make_string (Ok ("hello " ^name ^"!\n")));
(* echo request *) (* echo request *)
S.add_path_handler server S.add_path_handler server
"/echo" (fun req -> S.Response.make_string "/echo" (fun req -> S.Response.make_string

View file

@ -4,4 +4,4 @@
(public_name http_of_dir) (public_name http_of_dir)
(package tiny_httpd) (package tiny_httpd)
(flags :standard -warn-error -3) (flags :standard -warn-error -3)
(libraries tiny_httpd str)) (libraries tiny_httpd))

View file

@ -3,7 +3,7 @@ version: "0.1"
authors: ["Simon Cruanes"] authors: ["Simon Cruanes"]
maintainer: "simon.cruanes.2007@m4x.org" maintainer: "simon.cruanes.2007@m4x.org"
license: "MIT" license: "MIT"
description: "Minimal HTTP server using good old threads" synopsis: "Minimal HTTP server using good old threads"
build: [ build: [
["dune" "build" "@install" "-p" name "-j" jobs] ["dune" "build" "@install" "-p" name "-j" jobs]
["dune" "build" "@doc" "-p" name] {with-doc} ["dune" "build" "@doc" "-p" name] {with-doc}
@ -20,3 +20,4 @@ homepage: "https://github.com/c-cube/tiny_httpd/"
doc: "https://c-cube.github.io/tiny_httpd/" doc: "https://c-cube.github.io/tiny_httpd/"
bug-reports: "https://github.com/c-cube/tiny_httpd/issues" bug-reports: "https://github.com/c-cube/tiny_httpd/issues"
dev-repo: "git+https://github.com/c-cube/tiny_httpd.git" dev-repo: "git+https://github.com/c-cube/tiny_httpd.git"
post-messages: "tiny http server, with blocking IOs. Also ships with a `http_of_dir` program."