$ forester init > /dev/null $ echo 'fake png' > assets/pic.png $ cat > trees/index.tree << EOF > \title{HTTP server test} > \[src]{\route-asset{assets/pic.png}}{} > EOF $ forester start --no-browser & Forester is running on http://localhost:8080 $ SERVER_PID=$! $ curl -s --retry 5 --retry-connrefused http://localhost:8080 > response.html $ cat response.html | grep -Fo 'HTTP server test' HTTP server test HTTP server test HTTP server test HTTP server test HTTP server test $ tr '\n' ' ' < response.html | grep -Fo ']*>' The json manifest is available: $ curl -s http://localhost:8080/forest.json | grep -Fo '"title":"HTTP server test"' "title":"HTTP server test" Links in the manifest are routed to preview: $ curl -s http://localhost:8080/forest.json | grep -Fo '/preview/index/' /preview/index/ The docs are routed like any other foreign forest $ curl -s --retry 5 --retry-connrefused http://localhost:8080/preview/foreign/forester-notes.org/index/ | grep -o "maintained by" maintained by maintained by Assets are available: $ curl -s -H "Hx-Request: true" http://localhost:8080/home > home.html $ ASSET_SRC=$(grep -oE '/preview/[a-z0-9]+\.png' home.html) $ curl -s http://localhost:8080$ASSET_SRC fake png $ curl -s -o /dev/null -w '%{content_type}\n' http://localhost:8080$ASSET_SRC image/png $ kill $SERVER_PID $ wait $SERVER_PID 2>/dev/null || true