Playground
Samples of GenHTTP that run on this server - read their code, send requests to them from your browser and copy those requests as curl commands.
Every sample is a complete handler, as an application would write it. Most of them run live on this server: send the prepared requests (or change them) and see what GenHTTP responds. The others need something only your own machine can offer, so you get the commands to try them there.
Frameworks
Webservices
Implements a REST webservice via a handler class.
Live on this server
Functional
Uses delegates to implement a web service, similar to ASP.NET Core Minimal APIs.
Live on this server
Controllers
Uses controllers to implement a web service, similar to ASP.NET Core MVC.
Live on this server
Websockets
A chat that pushes every message to all browsers in the same room.
Live on this server
MCP Tools
Provides tools to AI agents such as Claude via the Model Context Protocol.
Live on this server
Static Websites
Hosts a static website, with index.html support.
Live on this server
Single Page Applications
Hosts a single page application such as a React or Angular app.
Live on this server
Custom Frameworks
Builds a framework of your own on top of the reflection layer.
Runs on your machine
Handlers
Layouting
Routes requests to the handlers an application is made of.
Live on this server
Static Files
Serves files from a directory or resource tree.
Live on this server
API Documentation
Generates an Open API definition and serves Swagger UI, Redoc and Scalar.
Live on this server
Server Sent Events
A live ticker that receives prices pushed by the server.
Live on this server
Pages
Renders HTML pages from templates on the server.
Live on this server
Virtual Hosting
Hosts multiple websites, one per domain, on a single server.
Runs on your machine
Load Balancing
Distributes requests over workers and mirrors, with a canary deployment.
Runs on your machine
Concerns
Authentication
Secures an API with API keys, roles and data per user.
Live on this server
CORS
Allows a frontend on another origin to call the API from the browser.
Live on this server
Error Handling
JSON errors for the API, HTML error pages for the website, custom mapping.
Live on this server
Localization
Responds in the language preferred by the user.
Runs on your machine
Inspection
Shows what the server received and responded, to debug clients.
Live on this server