You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
539 B
27 lines
539 B
package routes
|
|
|
|
import (
|
|
api "go_fabric/api/v1"
|
|
"go_fabric/middleware"
|
|
"net/http"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func NewRouter() *gin.Engine {
|
|
r := gin.Default()
|
|
|
|
r.Use(middleware.Cors())
|
|
r.StaticFS("/static", http.Dir("C:/Users/801028/Desktop/marketv1.2/go_fabric/static/"))
|
|
// jr.StaticFile("/avatar.jpg", "/GOCODE/go_fabric/static/imags/avatar/avatar.jpg")
|
|
v1 := r.Group("api/v1")
|
|
{
|
|
v1.GET("ping", func(ctx *gin.Context) {
|
|
ctx.JSON(200, "success")
|
|
})
|
|
//获取诗词
|
|
v1.GET("poem/gain", api.PoemGet)
|
|
}
|
|
return r
|
|
}
|