mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-07 11:45:36 -05:00
rename to tiny_httpd
This commit is contained in:
parent
49b46b1c4e
commit
3c5189a663
9 changed files with 28 additions and 14 deletions
21
README.md
21
README.md
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
# SimpleHTTPServer [](https://travis-ci.org/c-cube/simplehttpserver)
|
# Tiny_httpd [](https://travis-ci.org/c-cube/tiny_httpd)
|
||||||
|
|
||||||
Minimal HTTP server using good old threads and `Scanf` for routing.
|
Minimal HTTP server using good old threads and `Scanf` for routing.
|
||||||
|
|
||||||
|
|
@ -9,7 +9,7 @@ The basic echo server from `src/examples/echo.ml`:
|
||||||
|
|
||||||
```ocaml
|
```ocaml
|
||||||
|
|
||||||
module S = SimpleHTTPServer
|
module S = Tiny_httpd
|
||||||
|
|
||||||
let () =
|
let () =
|
||||||
let server = S.create () in
|
let server = S.create () in
|
||||||
|
|
@ -46,6 +46,21 @@ echo:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## `http_of_dir`
|
||||||
|
|
||||||
|
Similar to `python -m http.server`, a simple program `http_of_dir` is provided.
|
||||||
|
It serves files from the current directory.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ http_of_dir . -p 8080 &
|
||||||
|
$ curl -X GET http://localhost:8080
|
||||||
|
...
|
||||||
|
some html
|
||||||
|
...
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## Why?
|
## Why?
|
||||||
|
|
||||||
Why not? If you just want a super basic local server (perhaps for exposing
|
Why not? If you just want a super basic local server (perhaps for exposing
|
||||||
|
|
@ -54,7 +69,7 @@ dependencies or high scalability libraries.
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
See https://c-cube.github.io/simplehttpserver/
|
See https://c-cube.github.io/tiny_httpd
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,4 +3,4 @@
|
||||||
(name http_of_dir)
|
(name http_of_dir)
|
||||||
(public_name http_of_dir)
|
(public_name http_of_dir)
|
||||||
(flags :standard -warn-error -3)
|
(flags :standard -warn-error -3)
|
||||||
(libraries simplehttpserver str))
|
(libraries tiny_httpd str))
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
module S = SimpleHTTPServer
|
module S = Tiny_httpd
|
||||||
module Pf = Printf
|
module Pf = Printf
|
||||||
|
|
||||||
let contains_dot_dot s =
|
let contains_dot_dot s =
|
||||||
|
|
|
||||||
4
src/dune
4
src/dune
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
(library
|
(library
|
||||||
(name simplehttpserver)
|
(name tiny_httpd)
|
||||||
(public_name simplehttpserver)
|
(public_name tiny_httpd)
|
||||||
(libraries threads)
|
(libraries threads)
|
||||||
(wrapped false))
|
(wrapped false))
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
|
|
||||||
(executables
|
(executables
|
||||||
(names echo)
|
(names echo)
|
||||||
(libraries simplehttpserver))
|
(libraries tiny_httpd))
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
module S = SimpleHTTPServer
|
module S = Tiny_httpd
|
||||||
|
|
||||||
let debug_ k =
|
let debug_ k =
|
||||||
if None<>Sys.getenv_opt "HTTP_DBG" then (
|
if None<>Sys.getenv_opt "HTTP_DBG" then (
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
opam-version: "2.0"
|
opam-version: "2.0"
|
||||||
name: "simplehttpserver"
|
|
||||||
version: "0.1"
|
version: "0.1"
|
||||||
authors: ["Simon Cruanes"]
|
authors: ["Simon Cruanes"]
|
||||||
maintainer: "simon.cruanes.2007@m4x.org"
|
maintainer: "simon.cruanes.2007@m4x.org"
|
||||||
|
|
@ -17,7 +16,7 @@ depends: [
|
||||||
"odoc" {with-doc}
|
"odoc" {with-doc}
|
||||||
]
|
]
|
||||||
tags: [ "http" "thread" "server" ]
|
tags: [ "http" "thread" "server" ]
|
||||||
homepage: "https://github.com/c-cube/simplehttpserver/"
|
homepage: "https://github.com/c-cube/tiny_httpd/"
|
||||||
doc: "https://c-cube.github.io/simplehttpserver/"
|
doc: "https://c-cube.github.io/tiny_httpd/"
|
||||||
bug-reports: "https://github.com/c-cube/simplehttpserver/issues"
|
bug-reports: "https://github.com/c-cube/tiny_httpd/issues"
|
||||||
dev-repo: "git+https://github.com/c-cube/simplehttpserver.git"
|
dev-repo: "git+https://github.com/c-cube/tiny_httpd.git"
|
||||||
Loading…
Add table
Reference in a new issue