1
0

feat: bundle frontend files with api in one static bundle

This commit is contained in:
kolaente
2024-02-08 17:14:41 +01:00
parent 392f5cd468
commit 6c5194b892
3 changed files with 64 additions and 8 deletions

View File

@ -178,15 +178,9 @@ func RegisterRoutes(e *echo.Echo) {
// healthcheck
e.GET("/health", HealthcheckHandler)
// static files
if static := config.ServiceStaticpath.GetString(); static != "" {
e.Use(middleware.StaticWithConfig(middleware.StaticConfig{
Root: static,
HTML5: true,
}))
}
setupStaticFrontendFilesHandler(e)
// CORS_SHIT
// CORS
if config.CorsEnable.GetBool() {
e.Use(middleware.CORSWithConfig(middleware.CORSConfig{
AllowOrigins: config.CorsOrigins.GetStringSlice(),