Description
Flow is a small HTTP router for Go web applications. It matches routes with named parameters, wildcards and optional regular expression patterns, and it works with the standard http.Handler, http.HandlerFunc and ordinary Go middleware. You can create route groups that use different middleware, a common need in web apps. Custom handlers can be set for 404 Not Found and 405 Method Not Allowed responses, and OPTIONS and HEAD requests are handled automatically. The README lists zero dependencies and a codebase of about 160 lines. The notes explain how matching works: conflicting routes are allowed and matched in the order they are declared, trailing slashes matter, and an Allow header is set automatically for OPTIONS and 405 responses. Middleware must be declared before a route to apply to that route, and the mux is not safe to change with new middleware or routes while the server is handling requests. The README says the project has reached a stable status, is actively maintained with bug fixes, and is not expected to change its API significantly. The pattern matching is credited as being inspired by matryer's way package.…
Highlights
- Named parameters, wildcards and regex routes
- Route groups with their own middleware
- Custom 404 and 405 handlers
- Automatic OPTIONS and HEAD handling
- Zero dependencies, around 160 lines of code
Ratings & Reviews
No ratings yet
Be the first to rate Flow.
People also visit
Flow FAQ
What is Flow?
A small HTTP router for Go web applications that works with standard handlers and middleware.
Does it have dependencies?
No. The README says Flow has zero dependencies.
Can I group routes with middleware?
Yes. Route groups can use different middleware, and middleware must be declared before a route to apply to it.
Is the API stable?
The README says the project has reached stable status and significant API changes are not expected.
How are conflicting routes handled?
They are allowed and matched in the order they are declared, and trailing slashes count as part of the route.
What are the best Flow alternatives?
Popular alternatives to Flow include Shuttle, Go Http File Server and miniserve. See all Flow alternatives





