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