use yml
This commit is contained in:
11
main.go
11
main.go
@@ -50,10 +50,16 @@ func main() {
|
||||
|
||||
func registerRoutes(r *gin.Engine) {
|
||||
|
||||
var items []models.Content
|
||||
models.DB.Select("*").Find(&items)
|
||||
r.GET("/", func(c *gin.Context) {
|
||||
c.HTML(http.StatusOK, "index.tmpl", nil)
|
||||
c.HTML(http.StatusOK, "index.tmpl", gin.H{
|
||||
"Items": items,
|
||||
})
|
||||
})
|
||||
r.GET("/createcontent", func(c *gin.Context) {
|
||||
c.HTML(http.StatusOK, "content.tmpl", nil)
|
||||
})
|
||||
|
||||
user := getUserInfo()
|
||||
r.GET("/page/:id", func(c *gin.Context) {
|
||||
id := c.Param("id")
|
||||
@@ -72,6 +78,7 @@ func registerRoutes(r *gin.Engine) {
|
||||
|
||||
r.GET("/ws", controllers.WebSocketHandler)
|
||||
|
||||
r.POST("/content", controllers.CreateContentHandler)
|
||||
r.POST("/login", controllers.UsersLoginHandler)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user