ooyeku/engine12
A web framework for Zig
master44a0a22d0ca4fe6886a5dc9f27b5149544f2387e91ca9c501066144fa95a52237da110812e9aa145A professional backend framework for Zig, designed for building high-performance web applications and APIs.
const std = @import("std");
const Engine12 = @import("Engine12");
fn handleRoot(req: *Engine12.Request) Engine12.Response {
_ = req;
return Engine12.Response.text("Hello, World!");
}
pub fn main() !void {
var app = try Engine12.initDevelopment();
defer app.deinit();
try app.get("/", handleRoot);
try app.start();
}
Run zig fetch to add Engine12 to your build.zig.zon:
zig fetch --save "git+https://github.com/ooyeku/engine12.git"
This will automatically add the dependency with the correct hash to your build.zig.zon file.
Alternatively, you can manually add it to your build.zig.zon:
.dependencies = .{
.engine12 = .{
.url = "git+https://github.com/ooyeku/engine12.git",
.hash = "...", // Run `zig fetch` to get the hash
},
},
Add the dependency and module to your build.zig:
const engine12_dep = b.dependency("engine12", .{
.target = target,
.optimize = optimize,
});
exe.addModule("engine12", engine12_dep.module("engine12"));
If you're using the ORM or C API, you'll also need to link libc:
// Link libc (required for ORM and C API functionality)
exe.linkLibC();
See TODO.md for a complete feature list and roadmap.
See the todo app example for a complete working application demonstrating:
MIT License - see LICENSE file for details.
Contributions welcome! Please see our contributing guidelines.