diff --git a/main.go b/main.go index 9e083b5..2c99192 100644 --- a/main.go +++ b/main.go @@ -101,6 +101,12 @@ func registerRoutes(r *gin.Engine) { "user": user, }) }) + r.GET("/register", func(c *gin.Context) { + c.HTML(200, "register.tmpl", map[string]interface{}{ + "title": "这个是titile,传入templates中的", + "user": user, + }) + }) r.GET("/ws", controllers.WebSocketHandler) r.POST("/content", controllers.CreateContentHandler) diff --git a/templates/register.tmpl b/templates/register.tmpl new file mode 100644 index 0000000..f37d0b1 --- /dev/null +++ b/templates/register.tmpl @@ -0,0 +1,37 @@ + +
+
+

+
+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ +

+
+ +
+
+ + +