mirror of
https://github.com/SphericalKat/medium.rip.git
synced 2025-12-18 15:35:58 +00:00
Update api.go
This commit is contained in:
parent
9607e4fd17
commit
3b4c17e744
@ -12,6 +12,7 @@ import (
|
|||||||
|
|
||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
"github.com/gofiber/fiber/v2/middleware/filesystem"
|
"github.com/gofiber/fiber/v2/middleware/filesystem"
|
||||||
|
"github.com/gofiber/fiber/v2/middleware/proxy"
|
||||||
"github.com/gofiber/template/html/v2"
|
"github.com/gofiber/template/html/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -32,6 +33,11 @@ func RegisterRoutes(ctx context.Context, wg *sync.WaitGroup, engine *html.Engine
|
|||||||
Browse: config.Conf.Env == "dev",
|
Browse: config.Conf.Env == "dev",
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
if config.Conf.Proxy != ""
|
||||||
|
{
|
||||||
|
app.Use(proxy.Balancer(proxy.Config{ Servers: []string{ config.Conf.Proxy } , }))
|
||||||
|
}
|
||||||
|
|
||||||
routes.RegisterRoutes(app)
|
routes.RegisterRoutes(app)
|
||||||
|
|
||||||
go func(app *fiber.App) {
|
go func(app *fiber.App) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user