mirror of
https://github.com/GrassrootsEconomics/cic-dw.git
synced 2024-11-17 04:56:46 +01:00
Mohamed Sohail
77f127e14a
* feat: add admin/auth api - jwt cookie based auth - /auth - admin/* * add: meta proxy * fix: remove ussd account status from syncer * add: cookie defaults and nuxt init check route * add: pin and address handlers
29 lines
733 B
Go
29 lines
733 B
Go
package main
|
|
|
|
import (
|
|
"cic-dw/internal/admin"
|
|
"cic-dw/internal/dashboard"
|
|
"cic-dw/internal/public"
|
|
|
|
"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)
|
|
public.InitPublicApi(server, db, batchBalance, cicnetClient, preparedQueries.public)
|
|
admin.InitAdminApi(server, db, preparedQueries.admin, metaClient, conf.Jwt.Secret)
|
|
|
|
return server
|
|
}
|