cic-dw/cmd/server.go
Mohammed Sohail d4506e6303
update: (dashboard-api) cors and sql limits
- add cors for core websites and dev env
- update sql query limit to 2 years
- enabled future cors for auth
2022-05-12 12:32:33 +03:00

24 lines
511 B
Go

package main
import (
"cic-dw/internal/dashboard"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
)
func initHTTPServer() *echo.Echo {
server := echo.New()
server.HideBanner = true
// TODO: Remove after stable release
server.Debug = true
server.Use(middleware.CORSWithConfig(middleware.CORSConfig{
AllowOrigins: conf.Server.Cors,
AllowCredentials: true,
MaxAge: 600,
}))
dashboard.InitDashboardApi(server, db, preparedQueries.dashboard)
return server
}