prefect server in zig

web server #

the server uses http.zig through the in-tree wap adapter for HTTP and WebSocket connections on the same port. build.zig.zon pins the dependency; build.zig wires its HTTP and WebSocket modules into the server.

routing #

main.zig assembles the HTTP handler and WebSocket routes. wap/server.zig handles upgrades and adapts HTTP requests and responses for the application.

api/routes.zig handles CORS preflight and dispatches API requests to resource handlers. handlers use wap.Request and wap.Response; see the handler guide for parsing and response conventions.

optional UI #

set PREFECT_UI_STATIC_DIR to a built Prefect UI bundle to serve it from the same process. PREFECT_UI_SERVE_BASE sets its URL prefix. the server rewrites the bundle's base-path marker, serves /ui-settings as JSON bootstrap, and falls back to index.html for application routes while keeping API paths out of the SPA fallback.

api/static_ui.zig implements static serving; api/admin.zig provides the UI settings.