aboutsummaryrefslogtreecommitdiff
path: root/routes
diff options
context:
space:
mode:
authorGabriel A. Giovanini <mail@gabrielgio.me>2022-06-06 02:49:05 +0200
committerGabriel A. Giovanini <mail@gabrielgio.me>2022-06-06 02:49:05 +0200
commitf13a07aa433298de91e1c4aff68f72be6d851be2 (patch)
tree5ebb10ed5f91b251ccc16c74a631448b5abb6145 /routes
downloadmdir-f13a07aa433298de91e1c4aff68f72be6d851be2.tar.gz
mdir-f13a07aa433298de91e1c4aff68f72be6d851be2.tar.bz2
mdir-f13a07aa433298de91e1c4aff68f72be6d851be2.zip
Initial commit
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")
+}