Jetzig Logo

Jetzig Web Framework

Jetzig is an MIT licensed web framework written in Zig


Simple, file-based routing to RESTful Zig function declarations.


Templating with Zmpl provides layouts, partials, and build-time static content rendering.


All endpoints render JSON by default, providing a RESTful API for free.


Powered by http.zig for competitive performance and scalability.


User-friendly CLI tooling for creating projects and adding new components.


Hook into and manipulate requests/responses with a custom middleware chain. Built-in middleware for htmx .


Cookies, user sessions, and request/response headers out of the box.


Join us on Discord – we're friendly and active.

Open Source

Free, open source, and always will be. Jetzig is MIT licensed.

Simple, concise view functions

const std = @import("std");
const jetzig = @import("jetzig");

pub const layout = "application";

pub fn index(request: *jetzig.Request, data: *jetzig.Data) !jetzig.View {
    var object = try data.root(.object);

    try object.put("url", data.string(""));
    try object.put("title", data.string("Jetzig Website"));
    try object.put("message", data.string("Welcome to Jetzig!"));

    return request.render(.ok);

JSON by default on all endpoints

$ curl http://localhost:8080/example.json
  "url": "",
  "message": "Welcome to Jetzig!",
  "title": "Jetzig Website"

Live Example (JSON)
Live Example (HTML)

Easy email delivery with content templating

pub fn post(request: *jetzig.Request, data: *jetzig.Data) !jetzig.View {
    var object = try data.root(.object);
    const params = try request.params();

    // Set mail template params.
    try object.put("from", params.get("from"));
    try object.put("message", params.get("message"));

    // Create email.
    const mail = request.mail("contact", .{ .to = &.{""} });

    // Deliver asynchronously.
    try mail.deliver(.background, .{});

    return request.render(.created);

Modal templating with partials, Markdown, and Zig

    @partial header

    @markdown {
      # {{.message}}


    @zig {
      if (10 > 1) {
        <span>10 is greater than 1!</span>


    @partial link(href: .url, title: .title)

    @partial footer

Readable development logs


Background jobs

pub fn index(request: *jetzig.Request, data: *jetzig.Data) !jetzig.View {
    // Prepare a job using `src/app/jobs/example.zig`.
    var job = try request.job("example");

    // Add params to the job.
    try job.params.put("foo", data.string("bar"));
    try job.params.put("id", data.integer(;

    // Schedule the job for background processing.
    try job.schedule();

    return request.render(.ok);