How to Serve http-model Requests with the JDK HTTP Server
Serve a Request => Response function built on ZIO Blocks http-model with the HTTP server that ships with the JDK.
How to Validate Query Parameters and Headers and Answer 400
Read query parameters and headers as typed values with http-model-schema and answer bad input with a JSON 400 that names every problem.
How to Send Server-Sent Events with http-model
Stream Server-Sent Events from a ZIO Blocks http-model Response through the JDK HTTP server to curl and the browser's EventSource.
How to Return HTMX Fragments, Full Pages and Response Headers
Answer one URL with a full page or an htmx fragment, update a second spot out of band, and steer the browser with typed HX-* response headers.
How to Issue and Verify JWTs
Sign JWTs with HMAC, RSA or EdDSA keys, verify iss, aud and exp with a fixed clock, and reject tampered or hostile tokens.
How to Protect an Endpoint with JWT Bearer Tokens
Let only signed-in users call an http-model endpoint: read the bearer token, verify the JWT, and answer 401 or 403 correctly.
How to Protect Pages with Basic Auth or a Session Cookie
Protect http-model pages two ways: check HTTP Basic credentials with a 401 challenge, or log in with a form and an HttpOnly session cookie.
How to Write an OpenAPI Document and Export It as JSON or YAML
Describe a REST API as a typed OpenAPI value, generate its schemas from the same Schema used for JSON, and export it as JSON and YAML.
How to Generate Scala Types from an OpenAPI Spec at Build Time
Turn the component schemas of an OpenAPI document into Schema-ready Scala case classes, enums and sealed traits on every sbt build.