# web server the server uses [http.zig](https://tangled.org/zzstoatzz.io/http.zig) through the in-tree `wap` adapter for HTTP and WebSocket connections on the same port. [build.zig.zon](../build.zig.zon) pins the dependency; [build.zig](../build.zig) wires its HTTP and WebSocket modules into the server. ## routing [main.zig](../src/main.zig) assembles the HTTP handler and WebSocket routes. [wap/server.zig](../src/wap/server.zig) handles upgrades and adapts HTTP requests and responses for the application. [api/routes.zig](../src/api/routes.zig) handles CORS preflight and dispatches API requests to resource handlers. handlers use `wap.Request` and `wap.Response`; see the [handler guide](scratch/json-unification-handoff.md) 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](../src/api/static_ui.zig) implements static serving; [api/admin.zig](../src/api/admin.zig) provides the UI settings.