21 lines
320 B
Go
21 lines
320 B
Go
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")
|
|
} |