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