Skip to content
YetAnotherMechanicusEnjoyerPublic

About

A lightweight, high-performance standalone web server and directory explorer.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

51 Commits

Folders and files

Repository files navigation

wayra

AUR Version AUR Latest Version Nix Flake
AUR Publisher Binaries Publisher Zig CI
GitHub last commit GitHub License

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).

Features

  • 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.

Installation

Arch Linux (AUR)

Requires any AUR Helper like YaY

e.g.:

yay -S wayra        # Stable version
                    # or
yay -S wayra-git    # Latest version

Nix / NixOS

If 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/wayra

Install via a Flake:

environment.systemPackages = [
  inputs.wayra.packages.${pkgs.system}.default
];

(Note: I am purely speculating, I still need confirmation from a Nix user.)


Binaries

Download prebuilt binaries from releases


From Source

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 wayra

2. Build the executable using the Zig build system

zig build -Doptimize=ReleaseFast

The compiled binary will be available in the zig-out/bin/ directory.

Usage

$ 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 message

To 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>

Supported Files Formats for Preview

  • 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.

Contributing

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.

About

A lightweight, high-performance standalone web server and directory explorer.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Contributors

Languages