44 lines
945 B
Go
44 lines
945 B
Go
package main
|
|
|
|
import (
|
|
db "app/database"
|
|
|
|
_ "app/docs"
|
|
route "app/router"
|
|
|
|
"github.com/labstack/echo/v4"
|
|
echoSwagger "github.com/swaggo/echo-swagger"
|
|
)
|
|
|
|
// @title Swagger Example API
|
|
// @version 1.0
|
|
// @description This is a sample server celler server.
|
|
// @termsOfService http://swagger.io/terms/
|
|
|
|
// @contact.name API Support
|
|
// @contact.url http://www.swagger.io/support
|
|
// @contact.email support@swagger.io
|
|
|
|
// @license.name Apache 2.0
|
|
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html
|
|
|
|
// @host localhost:8000
|
|
|
|
// @securityDefinitions.basic BasicAuth
|
|
|
|
// @externalDocs.description OpenAPI
|
|
// @externalDocs.url https://swagger.io/resources/open-api/
|
|
func main() {
|
|
|
|
db.Create_tables()
|
|
|
|
e := echo.New()
|
|
e.GET("/swagger/*", echoSwagger.WrapHandler)
|
|
|
|
route.UserRoutes(e)
|
|
route.ProductRoutes(e)
|
|
route.CartRoutes(e)
|
|
route.LoginLogout(e)
|
|
e.Logger.Fatal(e.Start(":8000"))
|
|
}
|