A minimal, opinionated HTTP framework for Skuf. Build APIs and web services with zero boilerplate. Ships with the Skuf toolchain.
Route handlers with GET, POST, PUT, DELETE. Lambda-based request handling.
uglbt.log with info, warn, error. JSON-structured output by default.
No YAML, no XML, no config files. Just import and start serving.
Compiles to C. No runtime overhead, no garbage collector. As fast as a raw socket server.
Minimal API surface. An LLM can learn the entire framework in a single prompt.
Middleware, static files, WebSocket support, template rendering. Stage1+.
use uglbt.http, uglbt.log
mod main
fn main:
app := http.app()
app.get("/", |req|:
log.info("root_hit", { method: "GET" })
~ res.text(200, "Hello from uglbt!")
)
app.get("/health", |req|:
~ res.json(200, { status: "ok" })
)
app.post("/echo", |req|:
body := req.body()
~ res.text(200, body)
)
>> "listening on :8080"
http.listen(app, 8080)$ skuf run server.skf
listening on :8080
$ curl localhost:8080/
Hello from uglbt!
$ curl localhost:8080/health
{"status":"ok"}
$ curl -X POST -d "ping" localhost:8080/echo
pinghttp.app() -> AppCreate a new application instanceapp.get(path, handler)Register a GET route handlerapp.post(path, handler)Register a POST route handlerapp.put(path, handler)Register a PUT route handlerapp.delete(path, handler)Register a DELETE route handlerhttp.listen(app, port)Start the server on the given portres.text(status, body)Send a plain text responseres.json(status, data)Send a JSON responsereq.body() -> stringRead the request bodylog.info(event, data)Log an info-level structured eventlog.warn(event, data)Log a warning-level structured eventlog.error(event, data)Log an error-level structured eventFull implementation coming in stage1. Current stage0 supports transpilation to C with runtime stubs.
Install Skuf and start building HTTP services in minutes.