diff --git a/.gitignore b/.gitignore index a3e3022..17adbe7 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,6 @@ # vendor/ .vscode/ -tmp/ \ No newline at end of file +tmp/ + +micrach \ No newline at end of file diff --git a/controllers/threads_controller.go b/controllers/threads_controller.go index 3c180b9..479471f 100644 --- a/controllers/threads_controller.go +++ b/controllers/threads_controller.go @@ -7,7 +7,7 @@ import ( ) func GetThreads(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{"route": "get threads"}) + c.HTML(http.StatusOK, "index.html", nil) } func GetThread(c *gin.Context) { diff --git a/main.go b/main.go index 5125422..a3281ad 100644 --- a/main.go +++ b/main.go @@ -20,6 +20,7 @@ func main() { gin.SetMode(Config.App.Env) router := gin.Default() + router.LoadHTMLGlob("templates/*.html") router.GET("/", Controllers.GetThreads) router.POST("/", Controllers.CreateThread) router.GET("/:threadId", Controllers.GetThread) diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..24e9d10 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,25 @@ + + + + Micrach + + + + + + +
+INDEX +
+ + + \ No newline at end of file