Compare commits

..

No commits in common. "main" and "v0.2.1" have entirely different histories.
main ... v0.2.1

2 changed files with 12 additions and 8 deletions

View file

@ -15,7 +15,7 @@ build_release:
--build-arg GOLANG_VERSION=$GOLANG_VERSION --build-arg GOLANG_VERSION=$GOLANG_VERSION
--build-arg NODE_VERSION=$NODE_VERSION --build-arg NODE_VERSION=$NODE_VERSION
--build-arg ALPINE_VERSION=$ALPINE_VERSION --build-arg ALPINE_VERSION=$ALPINE_VERSION
--build-arg VERSION=$CI_COMMIT_TAG --build-arg APP_VERSION=$CI_COMMIT_TAG
--build-arg BUILD_TIME=$CI_JOB_STARTED_AT --build-arg BUILD_TIME=$CI_JOB_STARTED_AT
--tag $CURRENT_IMAGE --tag $CURRENT_IMAGE
--tag $LATEST_IMAGE --tag $LATEST_IMAGE

View file

@ -45,6 +45,10 @@ func SetupRoutes(e *echo.Echo, ctrl *controller.Controller, env *env.Config) {
e.Static("/css", "web/css") e.Static("/css", "web/css")
e.Static("/js", "web/js") e.Static("/js", "web/js")
e.GET("/", func(c echo.Context) error {
return c.Render(http.StatusOK, "index.html", nil)
})
api := e.Group("/api") api := e.Group("/api")
{ {
tableGroup := api.Group("/tables") tableGroup := api.Group("/tables")
@ -90,6 +94,13 @@ func SetupRoutes(e *echo.Echo, ctrl *controller.Controller, env *env.Config) {
}) })
} }
e.GET("/robots.txt", func(ctx echo.Context) error {
return ctx.String(http.StatusOK, "User-agent: *\nDisallow: /")
})
e.RouteNotFound("*", func(ctx echo.Context) error {
return ctx.Redirect(http.StatusTemporaryRedirect, "/")
})
if env.SwaggerHost != "" { if env.SwaggerHost != "" {
docs.SwaggerInfo.Title = "Café Plätschwiesle" docs.SwaggerInfo.Title = "Café Plätschwiesle"
docs.SwaggerInfo.Description = "This is the backend of Café Plätschwiesle" docs.SwaggerInfo.Description = "This is the backend of Café Plätschwiesle"
@ -101,12 +112,5 @@ func SetupRoutes(e *echo.Echo, ctrl *controller.Controller, env *env.Config) {
api.GET("/swagger/*", echoSwagger.WrapHandler) api.GET("/swagger/*", echoSwagger.WrapHandler)
zap.L().Info("swagger running", zap.String("url", env.SwaggerHost+"/api/swagger/index.html")) zap.L().Info("swagger running", zap.String("url", env.SwaggerHost+"/api/swagger/index.html"))
} }
e.GET("/robots.txt", func(ctx echo.Context) error {
return ctx.String(http.StatusOK, "User-agent: *\nDisallow: /")
})
e.RouteNotFound("*", func(c echo.Context) error {
return c.Render(http.StatusOK, "index.html", nil)
})
} }
} }