Skip to Content
Quickstart

Quickstart

Create a directory named public:

mkdir -p public printf '<h1>Bismillah.</h1>\n' > public/index.html

Start qaws on a high local port:

qaws --host 127.0.0.1 --port 8080 --serve ./public

Check the response:

curl -i http://127.0.0.1:8080/

Expected result:

  • 200 OK
  • Server: qaws/0.2.7
  • Connection: keep-alive
  • X-Content-Type-Options: nosniff
  • a weak representation ETag
  • Accept-Ranges: bytes
  • the contents of public/index.html

Run from Docker

The public image is published at ghcr.io/nulldoubt/qaws:

docker run --rm -p 8080:80 -v "$PWD/public:/public:ro" ghcr.io/nulldoubt/qaws:0.2.7

The container serves /public on port 80.

Build from source

qaws is a Zig 0.16.0 project with no package dependencies.

git clone https://github.com/nulldoubt/qaws.git cd qaws zig build ./zig-out/bin/qaws --host 127.0.0.1 --port 8080 --serve ./public

Use a config file

qaws never auto-loads qaws.json. Pass it explicitly:

qaws.json
{ "listen": { "host": "127.0.0.1", "port": 8080 }, "serve": "./public", "logging": { "format": "plain", "access": true } }

Validate before starting:

qaws check --config qaws.json

Start with the config:

qaws --config qaws.json

Command-line flags override config values:

qaws --config qaws.json --port 18086 --no-access-log
qaws docs. Built for static hosting.