Full compatibility achieved with Go's standard library
In the previous version of Flint, the design of Router and HandlerFunc was not fully compatible with Go's standard library (net/http).
Specifically, Flint did not implement the http.Handler interface, which meant it could not be used directly with:
http.Handle("/", router)http.ListenAndServe(":8080", router)This limitation prevented Flint from integrating smoothly with the existing stdlib ecosystem, including third-party libraries such as logging, middleware, and monitoring packages.
Server implementation.http.Handler was not supported.The issue was caused by the fact that the Router type did not implement the ServeHTTP(w http.ResponseWriter, r *http.Request) method.
In the new version:
Router now directly implements the http.Handler interface.HandlerFunc → Context design while exposing http.Handler compatibility externally.http.ListenAndServe(":8080", app.Router())
Compatibility was validated with the following scenarios:
app := flint.NewServer()
app.Get("/", func(ctx *flint.Context) {
ctx.String(200, "Hello World")
})
app.Run(":8080")
r := flint.NewRouter()
r.Handle("/", func(ctx *flint.Context) {
ctx.String(200, "Hello from stdlib")
})
http.Handle("/", r)
http.ListenAndServe(":8080", nil)
Both scenarios executed successfully.
Server conveniences or the direct stdlib http.Handler approach.