🔧Chore: 配置跨域
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user