blob: d78acc76dd57fe5b38e4ae04ae1a14df3d09f660 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
package routes
import (
"git.sr.ht/~gabrielgio/midr/controller"
"github.com/gin-gonic/gin"
)
func HandleRequests() {
r := gin.Default()
r.LoadHTMLGlob("templates/*")
r.GET("/", controller.GetEntries)
r.GET("entries/", controller.GetEntry)
r.POST("entries/", controller.CreateEntry)
r.GET("entries/:id", controller.GetEntry)
r.POST("entries/:id", controller.UpdateEntry)
r.DELETE("entries/:id", controller.DeleteEntry)
r.Run(":8000")
}
|