允许跨域
This commit is contained in:
parent
d41136c22f
commit
4051173743
@ -4,6 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/spf13/viper"
|
||||
"matrix-middle-service/internel/middleware"
|
||||
"matrix-middle-service/internel/route"
|
||||
"matrix-middle-service/pkg/config"
|
||||
"matrix-middle-service/pkg/database"
|
||||
@ -43,6 +44,7 @@ func Run() {
|
||||
|
||||
// 创建 fiber 服务器
|
||||
app = CreateApp(conf)
|
||||
middleware.UseCorsMiddleWare(app)
|
||||
// 设置路由
|
||||
route.SetupRoute(app, conf)
|
||||
|
||||
|
@ -11,7 +11,6 @@ func SetupRoute(app *fiber.App, conf *config.Conf) {
|
||||
if conf.Server.EnableSwag {
|
||||
SwaggerHandler(app)
|
||||
}
|
||||
|
||||
bot.SetupBotController(app)
|
||||
record.SetupRecordController(app)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user