std

command
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Standard library interop.

Okapi speaks net/http: existing handlers and middleware drop in unchanged, so an existing application can be adopted one route at a time. This example registers the same server three ways — standard middleware, standard handlers, and native Okapi handlers — and shows them sharing one middleware chain.

Run it, then try:

curl localhost:8080/greeting
curl localhost:8080/users/42          # r.PathValue inside a std handler
curl localhost:8080/api/legacy        # std handler behind group middleware
curl localhost:8080/assets/style.css  # http.FileServer on a catch-all
curl localhost:8080/users             # native handler, for contrast
curl -i localhost:8080/greeting       # note X-Powered-By from std middleware

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL