This example http server runs locally on a fuchsia device and serves files from a single public directory.
$ fx set core.x64 --with //garnet/examples/http/example_http_server $ fx build
To run the server on the fuchsia device, from fx shell:
run fuchsia-pkg://fuchsia.com/example_http_server#meta/example_http_server.cmx
To view the served webpage from the browser:
http://192.168.42.42/index.html
in your browser (or whatever the IP address of your fuchsia device is).To get the webpage with curl:
curl 192.168.42.47/index.html
(using your device's IP address).