go-chi/chi — reverse-engineered prompt

Reverse engineered prompt

GitHub

Build me a lightweight Go HTTP router library for building clean REST APIs. I want it to work naturally with the standard net/http package, so people can use normal handlers and middleware without learning a whole framework.

It should let developers define routes by method, add middleware globally or only for one route, group related routes, mount subrouters, and read URL parameters like article IDs or slugs. Please include support for nested routes, custom Not Found and Method Not Allowed handlers, context values, request cancellation, and timeouts.

Keep the core small, idiomatic, and dependency free. Add a useful middleware package with things like logging, request IDs, recovery from panics, real client IP handling, and timeout handling. Please also include solid tests and a few simple examples showing a welcome endpoint, article style REST routes, admin routes, and middleware usage.

Look up current Go docs online if you need to.

Want more depth? Deep Reverse