Gin
Fuego can be used with Gin by using the fuegogin
adaptor.
Instead of using the Server fuego.NewServer()
, you will use the Engine fuego.NewEngine()
along with your router.
The usage is similar to the default server, but you will need to declare the routes with fuegogin.Get
, fuegogin.Post
... instead of fuego.Get
, fuego.Post
...
Migrate incrementally
- Spawn an engine with
fuego.NewEngine()
. - Use
fuegogin.GetGin
instead ofgin.GET
to wrap the routes with OpenAPI declaration of the route, without even touching the existing controllers. - Replace the controllers one by one with Fuego controllers. You'll get complete OpenAPI documentation, validation, Content-Negotiation for each controller you replace!
- Enjoy the benefits of Fuego with your existing Gin application!
Example
Please refer to the Gin example for a complete and up-to-date example.