{"id":43833990,"url":"https://github.com/ooyeku/ziggurat","last_synced_at":"2026-04-02T11:53:17.236Z","repository":{"id":293161781,"uuid":"937018114","full_name":"ooyeku/ziggurat","owner":"ooyeku","description":"A modern, lightweight HTTP server framework for Zig that prioritizes performance, safety, and developer experience.","archived":false,"fork":false,"pushed_at":"2026-03-24T05:48:34.000Z","size":230,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-25T06:57:57.269Z","etag":null,"topics":["http","zig-library","zig-package"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ooyeku.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-22T06:12:02.000Z","updated_at":"2026-03-24T05:45:10.000Z","dependencies_parsed_at":"2025-09-12T15:18:45.414Z","dependency_job_id":null,"html_url":"https://github.com/ooyeku/ziggurat","commit_stats":null,"previous_names":["ooyeku/ziggurat"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/ooyeku/ziggurat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ooyeku%2Fziggurat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ooyeku%2Fziggurat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ooyeku%2Fziggurat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ooyeku%2Fziggurat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ooyeku","download_url":"https://codeload.github.com/ooyeku/ziggurat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ooyeku%2Fziggurat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31305886,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T09:48:21.550Z","status":"ssl_error","status_checked_at":"2026-04-02T09:48:19.196Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["http","zig-library","zig-package"],"created_at":"2026-02-06T03:34:50.334Z","updated_at":"2026-04-02T11:53:17.231Z","avatar_url":"https://github.com/ooyeku.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ziggurat\n\nA modern, lightweight HTTP server framework for Zig that prioritizes performance, safety, and developer experience. Version 2.0.0.\n\n[Zig 0.15.1](https://ziglang.org) | [MIT License](LICENSE)\n\n## Features\n\n- **Thread-per-connection** concurrency with arena allocators per request\n- **Router** with path parameters (`:id`) and wildcard matching (`/*`)\n- **Middleware pipeline** with short-circuit support\n- **CORS**, **rate limiting**, **session management**, and **security headers** built in\n- **TLS/HTTPS** support\n- **JSON serialization** helpers\n- **Metrics** and **logging** subsystems\n- **Query string** parsing at request time\n- **Custom response headers** via builder pattern\n- **Graceful shutdown** with `server.stop()`\n- No external dependencies — pure Zig standard library\n\n## Quick Start\n\n### New API (Recommended)\n\n```zig\nconst std = @import(\"std\");\nconst ziggurat = @import(\"ziggurat\");\n\npub fn main() !void {\n    var gpa = std.heap.GeneralPurposeAllocator(.{}){};\n    defer _ = gpa.deinit();\n    const allocator = gpa.allocator();\n\n    // Initialize features in one call\n    try ziggurat.features.initialize(allocator, .{\n        .logging = .{ .level = .info },\n        .metrics = .{ .max_requests = 1000 },\n    });\n    defer ziggurat.features.deinitialize();\n\n    // Build and start server\n    var builder = ziggurat.ServerBuilder.init(allocator);\n    var server = try builder\n        .host(\"0.0.0.0\")\n        .port(3000)\n        .readTimeout(5000)\n        .writeTimeout(5000)\n        .build();\n    defer server.deinit();\n\n    try server.get(\"/\", handleRoot);\n    try server.get(\"/users/:id\", handleUser);\n    try server.start();\n}\n\nfn handleRoot(request: *ziggurat.request.Request) ziggurat.response.Response {\n    _ = request;\n    return ziggurat.json(\"{\\\"status\\\":\\\"ok\\\"}\");\n}\n\nfn handleUser(request: *ziggurat.request.Request) ziggurat.response.Response {\n    const id = request.getParam(\"id\") orelse \"unknown\";\n    _ = id;\n    return ziggurat.json(\"{\\\"user\\\":\\\"found\\\"}\");\n}\n```\n\n### Classic API\n\n```zig\n// Initialize logger and metrics separately\ntry ziggurat.logger.initGlobalLogger(allocator);\ntry ziggurat.metrics.initGlobalMetrics(allocator, 1000);\ndefer ziggurat.metrics.deinitGlobalMetrics();\n```\n\n## HTTPS\n\n```zig\nvar builder = ziggurat.ServerBuilder.init(allocator);\nvar server = try builder\n    .host(\"0.0.0.0\")\n    .port(443)\n    .enableTls(\"cert.pem\", \"key.pem\")\n    .build();\n```\n\n## HTTP Methods\n\n```zig\ntry server.get(\"/path\", handler);\ntry server.post(\"/path\", handler);\ntry server.put(\"/path\", handler);\ntry server.delete(\"/path\", handler);\ntry server.patch(\"/path\", handler);\ntry server.head(\"/path\", handler);\n```\n\n## Middleware\n\n```zig\ntry server.useMiddleware(ziggurat.request_logger.requestLoggingMiddleware);\ntry server.useMiddleware(ziggurat.cors.corsMiddleware);\ntry server.useMiddleware(ziggurat.security.rate_limiter.rateLimitMiddleware);\n```\n\nMiddleware returns `null` to continue the pipeline or a `Response` to short-circuit.\n\n## Response Helpers\n\n```zig\nreturn ziggurat.json(\"{\\\"key\\\":\\\"value\\\"}\");\nreturn ziggurat.text(\"Hello, World!\");\nreturn ziggurat.errorResponse(.not_found, \"Not found\");\n\n// Builder pattern\nreturn ziggurat.response.Response.json(data)\n    .withStatus(.created)\n    .withHeaders(\u0026.{\"X-Custom: value\"});\n```\n\n## Examples\n\n1. **Todo API** — RESTful API with JSON handling\n   ```bash\n   zig build run-ex1\n   ```\n\n2. **Static File Server** — File serving with caching and security\n   ```bash\n   zig build run-ex2\n   ```\n\n## Building \u0026 Testing\n\n```bash\nzig build              # Build library and examples\nzig build test         # Run all tests (153 tests)\nzig build run-ex1      # Run todo-api example\nzig build run-ex2      # Run static-server example\n```\n\n## Requirements\n\n- Zig 0.15.1 or later\n\n## Installation\n\nSee [Usage Guide](docs/usage.md#installation) for details.\n\n## Documentation\n\n- [Usage Guide](docs/usage.md) — Comprehensive guide to using Ziggurat\n- [API Reference](docs/api-reference.md) — Detailed API documentation\n- [Examples](examples/) — Example applications and use cases\n\n## Contributing\n\nContributions are welcome. Please submit pull requests following the project's code style and including appropriate tests.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fooyeku%2Fziggurat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fooyeku%2Fziggurat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fooyeku%2Fziggurat/lists"}