From f13a07aa433298de91e1c4aff68f72be6d851be2 Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Mon, 6 Jun 2022 02:49:05 +0200 Subject: Initial commit --- routes/routes.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 routes/routes.go (limited to 'routes/routes.go') diff --git a/routes/routes.go b/routes/routes.go new file mode 100644 index 0000000..118a4a5 --- /dev/null +++ b/routes/routes.go @@ -0,0 +1,18 @@ +package routes + +import ( + "github.com/gin-gonic/gin" + "gitlab.com/gabrielgio/midr/controller" +) + +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") +} -- cgit v1.2.3