restapi

command
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

restapi demonstrates a tiny in-memory REST API with GET/POST/JSON + route params + query strings. Single-process, no DB.

CGO_ENABLED=1 go run -tags gogo ./examples/restapi

curl http://localhost:3001/users
curl http://localhost:3001/users/1
curl -XPOST -d '{"name":"Bob"}' -H 'Content-Type: application/json' http://localhost:3001/users
curl 'http://localhost:3001/users?q=alice'

Jump to

Keyboard shortcuts

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