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
480 B
27 lines
480 B
package routers
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
android "application/api/android"
|
|
pc "application/api/pc"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
// InitRouter 初始化路由信息
|
|
func InitRouter() *gin.Engine {
|
|
r := gin.Default()
|
|
|
|
api := r.Group("/api")
|
|
{
|
|
api.GET("/android/hello", android.Hello)
|
|
api.POST("/android/hello", android.Hello)
|
|
api.GET("/pc/hello", pc.Hello)
|
|
api.POST("/pc/hello", pc.Hello)
|
|
}
|
|
// 静态文件路由
|
|
r.StaticFS("/web", http.Dir("./dist/"))
|
|
return r
|
|
}
|