Some documentation refactoring. No code changes. (0.39.12)
This commit is contained in:
parent
6870149094
commit
f2e319c4a4
14 changed files with 430 additions and 1 deletions
20
docs/examples/net/http_mt_server.md
Normal file
20
docs/examples/net/http_mt_server.md
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# http_mt_server.fun
|
||||
|
||||
- Location: examples/net/http_mt_server.fun
|
||||
- Category: Networking / HTTP (multi-threaded)
|
||||
|
||||
Description
|
||||
- Thread-per-connection HTTP server built on io/socket.fun and io/thread.fun. For each accepted client, spawns a thread and returns a small HTML page.
|
||||
|
||||
How to run
|
||||
- From the repository root:
|
||||
- export FUN_LIB_DIR="./lib"
|
||||
- ./build_debug/fun examples/net/http_mt_server.fun
|
||||
- Then open http://127.0.0.1:8080/ (or the port printed on start)
|
||||
|
||||
Requirements
|
||||
- Uses stdlib io/socket.fun and io/thread.fun. No external extensions required.
|
||||
|
||||
See also
|
||||
- docs/examples/README.md
|
||||
- docs/examples/httpserver.md (deep-dive)
|
||||
22
docs/examples/net/http_mt_server_cgi.md
Normal file
22
docs/examples/net/http_mt_server_cgi.md
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
# http_mt_server_cgi.fun
|
||||
|
||||
- Location: examples/net/http_mt_server_cgi.fun
|
||||
- Category: Networking / HTTP with CGI (multi-threaded)
|
||||
|
||||
Description
|
||||
- Multi-threaded HTTP server (thread-per-connection) with CGI support. Serves static files from htdocs and executes .fun scripts as CGI using net/cgi.fun helpers.
|
||||
|
||||
How to run
|
||||
- From the repository root:
|
||||
- export FUN_LIB_DIR="./lib"
|
||||
- export FUN_EXEC="./build_debug/fun" # optional; auto-detected if omitted
|
||||
- export FUN_HTDOCS="./examples/data/htdocs" # optional
|
||||
- ./build_debug/fun examples/net/http_mt_server_cgi.fun
|
||||
- Try: http://127.0.0.1:8080/ and /hello.fun?name=Fun, /info.fun
|
||||
|
||||
Requirements
|
||||
- Uses stdlib io/socket.fun, io/thread.fun, and net/cgi.fun. No external extensions required.
|
||||
|
||||
See also
|
||||
- docs/examples/README.md
|
||||
- docs/examples/httpserver.md (deep-dive)
|
||||
24
docs/examples/net/http_server.md
Normal file
24
docs/examples/net/http_server.md
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# http_server.fun
|
||||
|
||||
- Location: examples/net/http_server.fun
|
||||
- Category: Networking / HTTP (blocking)
|
||||
|
||||
Description
|
||||
- Blocking HTTP server that serves static files and executes .fun CGI scripts via lib/net/http_server.fun.
|
||||
|
||||
How to run
|
||||
- From the repository root:
|
||||
- export FUN_LIB_DIR="./lib"
|
||||
- ./build_debug/fun examples/net/http_server.fun
|
||||
- Default docroot: ./examples/data/htdocs
|
||||
- Visit: http://127.0.0.1:8080/
|
||||
|
||||
Notes
|
||||
- For CGI .fun under htdocs, the server uses the Fun interpreter to execute them and forwards output as HTTP.
|
||||
|
||||
Requirements
|
||||
- Uses io/socket.fun and strings.fun; no external extensions required.
|
||||
|
||||
See also
|
||||
- docs/examples/README.md
|
||||
- docs/examples/httpserver.md (deep-dive)
|
||||
22
docs/examples/net/http_server_cgi.md
Normal file
22
docs/examples/net/http_server_cgi.md
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
# http_server_cgi.fun
|
||||
|
||||
- Location: examples/net/http_server_cgi.fun
|
||||
- Category: Networking / HTTP with CGI (blocking)
|
||||
|
||||
Description
|
||||
- Minimal CGI-capable HTTP server (blocking) using lib/net/http_cgi_server.fun. Serves static files and executes .fun scripts as CGI.
|
||||
|
||||
How to run
|
||||
- From the repository root:
|
||||
- export FUN_LIB_DIR="./lib"
|
||||
- export FUN_EXEC="./build_debug/fun" # optional; auto-detected if omitted
|
||||
- export FUN_HTDOCS="./examples/data/htdocs" # optional
|
||||
- ./build_debug/fun examples/net/http_server_cgi.fun
|
||||
- Try: http://127.0.0.1:8080/ and /hello.fun, /info.fun
|
||||
|
||||
Requirements
|
||||
- Uses stdlib io/socket.fun, strings.fun, and net/cgi.fun. No external extensions required.
|
||||
|
||||
See also
|
||||
- docs/examples/README.md
|
||||
- docs/examples/httpserver.md (deep-dive)
|
||||
22
docs/examples/net/http_server_cgi_lib.md
Normal file
22
docs/examples/net/http_server_cgi_lib.md
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
# http_server_cgi_lib.fun
|
||||
|
||||
- Location: examples/net/http_server_cgi_lib.fun
|
||||
- Category: Networking / HTTP with CGI (blocking, stdlib helpers)
|
||||
|
||||
Description
|
||||
- Blocking HTTP server that serves static files and runs .fun as CGI using helpers from lib/net/http_cgi_lib_server.fun and net/cgi.fun.
|
||||
|
||||
How to run
|
||||
- From the repository root:
|
||||
- export FUN_LIB_DIR="./lib"
|
||||
- export FUN_EXEC="./build_debug/fun" # optional; auto-detected if omitted
|
||||
- export FUN_HTDOCS="./examples/data/htdocs" # optional
|
||||
- ./build_debug/fun examples/net/http_server_cgi_lib.fun
|
||||
- Try: http://127.0.0.1:8080/ and /hello.fun, /info.fun
|
||||
|
||||
Requirements
|
||||
- Uses stdlib io/socket.fun, strings.fun, net/cgi.fun. No external extensions required.
|
||||
|
||||
See also
|
||||
- docs/examples/README.md
|
||||
- docs/examples/httpserver.md (deep-dive)
|
||||
20
docs/examples/net/http_static_server.md
Normal file
20
docs/examples/net/http_static_server.md
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# http_static_server.fun
|
||||
|
||||
- Location: examples/net/http_static_server.fun
|
||||
- Category: Networking / Sockets
|
||||
|
||||
Description
|
||||
- Minimal static HTTP server implemented directly on sockets. Accepts connections and always returns a small HTML page.
|
||||
|
||||
How to run
|
||||
- From the repository root:
|
||||
- export FUN_LIB_DIR="./lib"
|
||||
- ./build_debug/fun examples/net/http_static_server.fun
|
||||
- Then open http://127.0.0.1:8088/
|
||||
|
||||
Requirements
|
||||
- Uses core IO/socket stdlib (io/socket.fun). No optional extensions required.
|
||||
|
||||
See also
|
||||
- docs/examples/README.md
|
||||
- docs/examples/httpserver.md (deep-dive over HTTP servers)
|
||||
Loading…
Add table
Add a link
Reference in a new issue