HTTPAPIServerIndex index
(c *gin.Context)
| 42 | |
| 43 | //HTTPAPIServerIndex index |
| 44 | func HTTPAPIServerIndex(c *gin.Context) { |
| 45 | _, all := Config.list() |
| 46 | if len(all) > 0 { |
| 47 | c.Header("Cache-Control", "no-cache, max-age=0, must-revalidate, no-store") |
| 48 | c.Header("Access-Control-Allow-Origin", "*") |
| 49 | c.Redirect(http.StatusMovedPermanently, "stream/player/"+all[0]) |
| 50 | } else { |
| 51 | c.HTML(http.StatusOK, "index.tmpl", gin.H{ |
| 52 | "port": Config.Server.HTTPPort, |
| 53 | "version": time.Now().String(), |
| 54 | }) |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | //HTTPAPIServerStreamPlayer stream player |
| 59 | func HTTPAPIServerStreamPlayer(c *gin.Context) { |