diff --git a/main.go b/main.go index 5b72ed6..96cc713 100644 --- a/main.go +++ b/main.go @@ -16,6 +16,7 @@ const ( func main() { router := gin.Default() + router.LoadHTMLGlob("./templates/*") // Middleware //e.Use(middleware.Logger()) //e.Use(middleware.Recover()) @@ -53,15 +54,7 @@ func restricted(c *gin.Context) { } func login(c *gin.Context) { - c.String(http.StatusOK, ` - Login - -
- - -
- - `) + c.HTML(http.StatusOK, "login.html", nil) } func loginPost(c *gin.Context) { diff --git a/templates/login.html b/templates/login.html new file mode 100644 index 0000000..a04ff6b --- /dev/null +++ b/templates/login.html @@ -0,0 +1,14 @@ + + Login + +
+ +
+ + +
+ + Login
+ + + \ No newline at end of file