mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2026-03-07 21:37:57 -05:00
Compare commits
2 commits
a07936dac4
...
f7ec687158
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f7ec687158 | ||
|
|
1b53064ed6 |
6 changed files with 81 additions and 43 deletions
|
|
@ -1,4 +1,12 @@
|
||||||
|
|
||||||
|
## 0.20
|
||||||
|
|
||||||
|
- eio backend, second try (#95)
|
||||||
|
- hardening bugfixes
|
||||||
|
- feat WS: abstraction for critical section
|
||||||
|
- feat route: add `to_url`, to produce a URL path from a route
|
||||||
|
- fix some warnings
|
||||||
|
|
||||||
## 0.19
|
## 0.19
|
||||||
|
|
||||||
- feat(headers): `set` will not reallocate whole list if not needed
|
- feat(headers): `set` will not reallocate whole list if not needed
|
||||||
|
|
|
||||||
96
dune-project
96
dune-project
|
|
@ -1,51 +1,73 @@
|
||||||
(lang dune 3.2)
|
(lang dune 3.2)
|
||||||
|
|
||||||
(name tiny_httpd)
|
(name tiny_httpd)
|
||||||
|
|
||||||
(generate_opam_files true)
|
(generate_opam_files true)
|
||||||
|
|
||||||
(authors c-cube)
|
(authors c-cube)
|
||||||
|
|
||||||
(maintainers c-cube)
|
(maintainers c-cube)
|
||||||
(version 0.19)
|
|
||||||
(source (github c-cube/tiny_httpd))
|
(version 0.20)
|
||||||
|
|
||||||
|
(source
|
||||||
|
(github c-cube/tiny_httpd))
|
||||||
|
|
||||||
(homepage https://github.com/c-cube/tiny_httpd/)
|
(homepage https://github.com/c-cube/tiny_httpd/)
|
||||||
|
|
||||||
(license MIT)
|
(license MIT)
|
||||||
|
|
||||||
(package
|
(package
|
||||||
(name tiny_httpd)
|
(name tiny_httpd)
|
||||||
(synopsis "Minimal HTTP server using threads")
|
(synopsis "Minimal HTTP server using threads")
|
||||||
(tags (http thread server tiny_httpd http_of_dir simplehttpserver))
|
(tags
|
||||||
(depopts
|
(http thread server tiny_httpd http_of_dir simplehttpserver))
|
||||||
logs
|
(depopts
|
||||||
magic-mime
|
logs
|
||||||
(mtime (>= 2.0)))
|
magic-mime
|
||||||
(depends
|
(mtime
|
||||||
seq
|
(>= 2.0)))
|
||||||
base-threads
|
(depends
|
||||||
result
|
seq
|
||||||
hmap
|
base-threads
|
||||||
(iostream (>= 0.2))
|
result
|
||||||
(ocaml (>= 4.13))
|
hmap
|
||||||
(odoc :with-doc)
|
(iostream
|
||||||
(logs :with-test)
|
(>= 0.2))
|
||||||
(conf-libcurl :with-test)
|
(ocaml
|
||||||
(ptime :with-test)
|
(>= 4.13))
|
||||||
(qcheck-core (and (>= 0.91) :with-test))))
|
(odoc :with-doc)
|
||||||
|
(logs :with-test)
|
||||||
|
(conf-libcurl :with-test)
|
||||||
|
(ptime :with-test)
|
||||||
|
(qcheck-core
|
||||||
|
(and
|
||||||
|
(>= 0.91)
|
||||||
|
:with-test))))
|
||||||
|
|
||||||
(package
|
(package
|
||||||
(name tiny_httpd_camlzip)
|
(name tiny_httpd_camlzip)
|
||||||
(synopsis "Interface to camlzip for tiny_httpd")
|
(synopsis "Interface to camlzip for tiny_httpd")
|
||||||
(depends
|
(depends
|
||||||
(tiny_httpd (= :version))
|
(tiny_httpd
|
||||||
(camlzip (>= 1.06))
|
(= :version))
|
||||||
(iostream-camlzip (>= 0.2.1))
|
(camlzip
|
||||||
(logs :with-test)
|
(>= 1.06))
|
||||||
(odoc :with-doc)))
|
(iostream-camlzip
|
||||||
|
(>= 0.2.1))
|
||||||
|
(logs :with-test)
|
||||||
|
(odoc :with-doc)))
|
||||||
|
|
||||||
(package
|
(package
|
||||||
(name tiny_httpd_eio)
|
(name tiny_httpd_eio)
|
||||||
(synopsis "Use eio for tiny_httpd")
|
(synopsis "Use eio for tiny_httpd")
|
||||||
(depends
|
(depends
|
||||||
(tiny_httpd (= :version))
|
(tiny_httpd
|
||||||
(eio (and (>= 1.0) (< 2.0)))
|
(= :version))
|
||||||
base-unix
|
(eio
|
||||||
(logs :with-test)
|
(and
|
||||||
(odoc :with-doc)))
|
(>= 1.0)
|
||||||
|
(< 2.0)))
|
||||||
|
base-unix
|
||||||
|
(logs :with-test)
|
||||||
|
(odoc :with-doc)))
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,6 @@
|
||||||
especially since Eio itself is also subject to change.
|
especially since Eio itself is also subject to change.
|
||||||
@since NEXT_RELEASE *)
|
@since NEXT_RELEASE *)
|
||||||
|
|
||||||
(* TODO: pass in a switch *)
|
|
||||||
|
|
||||||
type 'a with_args =
|
type 'a with_args =
|
||||||
?addr:string ->
|
?addr:string ->
|
||||||
?port:int ->
|
?port:int ->
|
||||||
|
|
@ -28,4 +26,14 @@ val create :
|
||||||
unit ->
|
unit ->
|
||||||
Tiny_httpd.Server.t)
|
Tiny_httpd.Server.t)
|
||||||
with_args
|
with_args
|
||||||
(** Create a server *)
|
(** Create a server.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
{[
|
||||||
|
Eio_main.run @@ fun stdenv ->
|
||||||
|
Eio.Switch.run ~name:"my_server" @@ fun sw ->
|
||||||
|
let server = Tiny_httpd_eio.create ~port:8080 ~stdenv ~sw () in
|
||||||
|
(* add routes... *)
|
||||||
|
Tiny_httpd.Server.add_route_handler [....];
|
||||||
|
Tiny_httpd.Server.run_exn server
|
||||||
|
]} *)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# This file is generated by dune, edit dune-project instead
|
# This file is generated by dune, edit dune-project instead
|
||||||
opam-version: "2.0"
|
opam-version: "2.0"
|
||||||
version: "0.19"
|
version: "0.20"
|
||||||
synopsis: "Minimal HTTP server using threads"
|
synopsis: "Minimal HTTP server using threads"
|
||||||
maintainer: ["c-cube"]
|
maintainer: ["c-cube"]
|
||||||
authors: ["c-cube"]
|
authors: ["c-cube"]
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# This file is generated by dune, edit dune-project instead
|
# This file is generated by dune, edit dune-project instead
|
||||||
opam-version: "2.0"
|
opam-version: "2.0"
|
||||||
version: "0.19"
|
version: "0.20"
|
||||||
synopsis: "Interface to camlzip for tiny_httpd"
|
synopsis: "Interface to camlzip for tiny_httpd"
|
||||||
maintainer: ["c-cube"]
|
maintainer: ["c-cube"]
|
||||||
authors: ["c-cube"]
|
authors: ["c-cube"]
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# This file is generated by dune, edit dune-project instead
|
# This file is generated by dune, edit dune-project instead
|
||||||
opam-version: "2.0"
|
opam-version: "2.0"
|
||||||
version: "0.19"
|
version: "0.20"
|
||||||
synopsis: "Use eio for tiny_httpd"
|
synopsis: "Use eio for tiny_httpd"
|
||||||
maintainer: ["c-cube"]
|
maintainer: ["c-cube"]
|
||||||
authors: ["c-cube"]
|
authors: ["c-cube"]
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue