package main
import (
"github.com/gin-gonic/gin"
)
func main() {
router := gin.New()
router.LoadHTMLFiles("./public/index.html")
router.GET("test", func(c *gin.Context) {
res := []string{"foo", "bar"}
c.JSON(200, res)
})
router.GET("/room/:roomId", func(c *gin.Context) {
c.HTML(200, "index.html", nil)
})
router.GET("/ws/:roomId", func(c *gin.Context) {
roomId := c.Param("roomId")
serveWs(c.Writer, c.Request, roomId)
})
router.Run("0.0.0.0:8080")
}