🔧Chore: 配置跨域

This commit is contained in:
2026-03-24 11:56:25 +08:00
parent 0200ca99b2
commit fe966d876f
2 changed files with 23 additions and 0 deletions
+2
View File
@@ -2,6 +2,7 @@ package main
import (
handle "agent/handlers"
"agent/middlewares"
"context"
"fmt"
"log"
@@ -46,6 +47,7 @@ func init() {
func main() {
route := gin.Default()
route.Use(middlewares.Cors())
route.GET("/ping", func(c *gin.Context) {
c.JSON(200, gin.H{
"message": "pong",