review/router/router.go

21 lines
320 B
Go
Raw Permalink Normal View History

2022-11-06 19:03:35 +08:00
package router
import (
"review/api"
"github.com/gin-gonic/gin"
)
func InitRouter() {
r := gin.Default()
r.GET("/users", api.GetUsers)
r.GET("/user", api.GetUser)
r.POST("/user", api.CreateUser)
r.PUT("/user", api.UpdateUser)
r.DELETE("/user", api.DeleteUser)
r.POST("/login", api.Login)
r.Run(":8000")
}