A lightweight, high-performance standalone web server and directory explorer written in Zig.
wayra serves local directories over HTTP and provides a modern, responsive single-page web interface to browse, preview, and interact with files directly from the browser (inspired by Python's builtin HTTP server).
- Instant File Previews:
- Markdown: Native rendering within an isolated environment and live Source/Preview toggling.
- HTML: Secure, isolated rendering via sandboxed iframes.
- Media: In-browser playback and viewing for images, audio, and video files.
- Code & Text: Raw code viewer with line numbers.
- Real-time Filtering: Client-side search to quickly filter files within the current directory.
- Zero Frontend Build Step: The frontend relies strictly on standard web technologies (HTML/CSS/JS). External libraries (like
marked.js) are fetched dynamically at runtime only when needed.
Arch Linux (AUR)
Requires any AUR Helper like YaY
e.g.:
yay -S wayra # Stable version
# or
yay -S wayra-git # Latest versionIf you use Nix with flakes enabled, you can run or install wayra instantly in a reproducible way:
Run directly without installation:
nix run github:YetAnotherMechanicusEnjoyer/wayraInstall via a Flake:
environment.systemPackages = [
inputs.wayra.packages.${pkgs.system}.default
];(Note: I am purely speculating, I still need confirmation from a Nix user.)
Download prebuilt binaries from releases
0. Prerequesites
To build and run this project from source, you will need Zig 0.16.0.
1. Clone the repository
git clone https://github.com/YetAnotherMechanicusEnjoyer/wayra.git
cd wayra2. Build the executable using the Zig build system
zig build -Doptimize=ReleaseFastThe compiled binary will be available in the zig-out/bin/ directory.
$ wayra -h
:: Usage:
wayra [OPTIONS]
:: Options:
-b, --bind <host> <port> Server address (default: :: 8000)
-d, --dir <root directory> Server root directory (default: ".")
-h, --help Display this help messageTo start the server, run the built executable and specify the root directory you want to serve.
wayra --dir /path/to/your/folder(Note: Adjust the command line arguments based on your specific implementation. If the server serves the current working directory by default, simply running wayra is sufficient.)
Once the server is running, open your web browser and navigate to one of the following:
http://[::1]:8000
http://localhost:8000
http://<address>:<port>- Rendered:
.md,.html - Images:
.png,.jpg,.jpeg,.gif,.svg,.webp,.ico - Video/Audio:
.mp4,.webm,.mkv,.mov,.mp3,.wav,.ogg,.flac,.m4a - Documents:
.pdf - Text/Code: any file not containing null bytes.
Contributions are welcome. Please ensure that your code adheres to the existing style and that you test your changes locally before submitting a pull request.