personal-website/routewde/wde.go

31 lines
695 B
Go
Raw Normal View History

2023-03-17 01:16:51 +00:00
package routewde
import (
"net/http"
2023-03-22 21:53:06 +00:00
"personalwebsite/webfilesystem"
2023-03-17 01:16:51 +00:00
"github.com/gin-gonic/gin"
)
func Route(route *gin.RouterGroup) {
route.GET("/getbasicwindow", func(ctx *gin.Context) {
ctx.HTML(http.StatusOK, "basic-window.html", nil)
})
2023-03-22 21:53:06 +00:00
2023-04-13 01:09:07 +00:00
route.GET("/renderMobileDesktop", func(ctx *gin.Context) {
ctx.HTML(http.StatusOK, "base/mobile-desktop.tmpl", nil)
})
2023-03-22 21:53:06 +00:00
widgets := route.Group("widgets")
{
widgets.GET("/file-tile-view", func(ctx *gin.Context) {
fs := webfilesystem.WebFileSystem{}
2023-04-25 09:37:42 +00:00
list, _ := fs.List("/") //TODO check errors
2023-03-22 21:53:06 +00:00
ctx.HTML(http.StatusOK, "wde-widgets/file-tile-view.tmpl", gin.H{
"Name": "Greg Brzezinski",
"Files": list,
})
})
}
2023-03-17 01:16:51 +00:00
}