mirror of
https://github.com/GrassrootsEconomics/cic-dw.git
synced 2024-11-14 03:46:46 +01:00
Mohammed Sohail
d4506e6303
- add cors for core websites and dev env - update sql query limit to 2 years - enabled future cors for auth
24 lines
511 B
Go
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
|
|
}
|