22 lines
360 B
Go
22 lines
360 B
Go
package Router
|
|
|
|
import (
|
|
"ESG/Controllers"
|
|
"ESG/Middlewares"
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func InitRouter() {
|
|
router := gin.Default()
|
|
router.Use(Middlewares.Cors())
|
|
|
|
toC := router.Group("/api")
|
|
{
|
|
toC.GET("/list", Controllers.GetList)
|
|
toC.GET("/details", Controllers.GetDetails)
|
|
toC.POST("/issue", Controllers.SetNews)
|
|
}
|
|
|
|
router.Run(":51002")
|
|
}
|