personal-website/main.go

43 lines
898 B
Go
Raw Normal View History

2023-03-15 00:05:24 +00:00
package main
import (
"log"
"net/http"
2023-03-15 12:32:41 +00:00
personalpropsroute "personalwebsite/approutes/personalPropsRoute"
2023-03-15 00:05:24 +00:00
"github.com/gin-gonic/gin"
)
func main() {
router := gin.New()
// router.Use(rateLimit, gin.Recovery())
router.LoadHTMLGlob("resources/*.html")
// router.Static("/static", "resources/static")
router.Static("/res", "resources")
router.GET("/", index)
router.GET("/getmockapp", func(ctx *gin.Context) {
2023-03-15 12:32:41 +00:00
2023-03-15 00:05:24 +00:00
})
2023-03-15 12:32:41 +00:00
apps := router.Group("applications")
{
personalpropsroute.Route(apps.Group("/personalproperties"))
}
2023-03-15 00:05:24 +00:00
// router.GET("/room/:roomid", roomGET)
// router.POST("/room-post/:roomid", roomPOST)
// router.GET("/stream/:roomid", streamRoom)
// port := os.Getenv("PORT")
// if port == "" {
// port = "8080"
// }
if err := router.Run(":8080"); err != nil {
log.Panicf("error: %s", err)
}
}
func index(c *gin.Context) {
c.HTML(http.StatusOK, "base.html", nil)
}