All Downloads are FREE. Search and download functionalities are using the official Maven repository.

go-echo-server.main.mustache Maven / Gradle / Ivy

There is a newer version: 7.6.0
Show newest version
package main

import (
	"{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}/handlers"
	"github.com/labstack/echo/v4"
	"github.com/labstack/echo/v4/middleware"
)

func main() {
	e := echo.New()

	//todo: handle the error!
	c, _ := handlers.NewContainer()

	// Middleware
	e.Use(middleware.Logger())
	e.Use(middleware.Recover())

{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}
	// {{nickname}} - {{{summary}}}{{#isDeprecated}} (deprecated){{/isDeprecated}}
	e.{{httpMethod.toUpperCase}}("{{{basePathWithoutHost}}}{{{path}}}", c.{{operationId}})
{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}

	// Start server
	e.Logger.Fatal(e.Start(":{{serverPort}}"))
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy