Its a small vanilla C very basic program which lets you host html or whatever file on localhost.
$ git clone https://github.com/trmaa/vanilla_c_web_server.git
$ cd vanilla_c_web_server
$ chmod +x ./scripts/make.sh
$ c -n serve -i include build install # C tool is my own build tool which you can find at my github, if not, run the following commands:
gcc src/*.c -o serve -Iinclude
cp serve /usr/bin/serve$ serve -h
Usage: serve [-p port] [-d directory]
Options:
-h HELP
-v VERSION
-p PORT (default: 8080)
-d DIR (default: ./)Example:
$ serve -d example/
$ firefox http://localhost:8080/index.htmlTODO:
- It lacks url encoding,
- file trees for directorys,
- querys...
FLAWS:
- It core dumps for no reason some times.