Files
upstream-chi/_examples/README.md
upstream-mirror 72c9f2ee75
Some checks failed
Test / test (1.24.x, ubuntu-latest) (push) Successful in 2m56s
Test / test (1.25.x, ubuntu-latest) (push) Successful in 2m15s
Test / test (1.26.x, ubuntu-latest) (push) Successful in 2m23s
Test / test (1.27.x, ubuntu-latest) (push) Failing after 3m56s
Test / test (1.24.x, windows-latest) (push) Has been cancelled
Test / test (1.25.x, windows-latest) (push) Has been cancelled
Test / test (1.26.x, windows-latest) (push) Has been cancelled
Test / test (1.27.x, windows-latest) (push) Has been cancelled
snapshot of https://github.com/go-chi/chi.git (master, 2026-09-15; blobs > 131072B omitted)
2026-09-15 21:48:17 +05:00

1.9 KiB

chi examples

  • custom-handler - Use a custom handler function signature
  • custom-method - Add a custom HTTP method
  • fileserver - Easily serve static files
  • graceful - Graceful context signaling and server shutdown
  • hello-world - Hello World!
  • limits - Timeouts and Throttling
  • logging - Easy structured logging for any backend
  • rest - REST APIs made easy, productive and maintainable
  • router-walk - Print to stdout a router's routes
  • todos-resource - Struct routers/handlers, an example of another code layout style
  • versions - Demo of chi/render subpkg
  • pathvalue - Demonstrates PathValue usage for retrieving URL parameters

Usage

  1. go get -v -d -u ./... - fetch example deps
  2. cd <example>/ ie. cd rest/
  3. go run *.go - note, example services run on port 3333
  4. Open another terminal and use curl to send some requests to your example service, curl -v http://localhost:3333/
  5. Read /main.go source to learn how service works and read comments for usage