18 lines
313 B
Go
18 lines
313 B
Go
package handlers
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func Register(router *gin.Engine) {
|
|
v1 := router.Group("api/v1")
|
|
posts := v1.Group("posts")
|
|
{
|
|
posts.GET("/", GetPosts)
|
|
posts.GET("/:id", GetPost)
|
|
posts.POST("/", CreatePost)
|
|
posts.PUT("/:id", UpdatePost)
|
|
posts.DELETE("/:id", DeletePost)
|
|
}
|
|
}
|