mirror of
https://github.com/GrassrootsEconomics/cic-dw.git
synced 2026-05-28 15:27:56 +02:00
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
This commit is contained in:
@@ -21,7 +21,8 @@ type config struct {
|
||||
Redis string `koanf:"redis"`
|
||||
}
|
||||
Server struct {
|
||||
Address string `koanf:"address"`
|
||||
Address string `koanf:"address"`
|
||||
Cors []string `koanf:"cors"`
|
||||
}
|
||||
Chain struct {
|
||||
RpcProvider string `koanf:"rpc"`
|
||||
|
||||
@@ -3,14 +3,19 @@ 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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user