aboutsummaryrefslogtreecommitdiff
path: root/routes
diff options
context:
space:
mode:
Diffstat (limited to 'routes')
-rw-r--r--routes/routes.go18
1 files changed, 18 insertions, 0 deletions
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")
+}