Echo
Fuego can be seamlessly integrated with echo framework using the fuegoecho
adaptor.
Instead of utilizing the default server Setup with fuego.NewServer()
, you will use the Engine with fuego.NewEngine()
, alongside your Echo router.
The integration process mirrors the default server setup, with the key difference being that you will declare routes using fuegoecho.Get
, fuegoecho.Post
, etc., rather than fuego.Get
, fuego.Post
.
Incremental Migration
Follow these steps to gradually integrate Fuego into your Echo application:
- Instantiate the engine using
fuego.NewEngine()
. - Replace
echo.GET
withfuegoecho.GetEcho
to wrap your routes with the OpenAPI declaration, without modifying your existing controllers. - Incrementally replace your existing controllers with Fuego controllers (
fuegoecho.Get
), enabling automatic generation of OpenAPI documentation, validation, and content-negotiation for each controller you replace. - Enjoy the enhanced functionality provided by Fuego while maintaining compatibility with your existing Echo application.
Example
For a comprehensive, up-to-date example, please refer to the Echo example.