Files
ais/main.go
2022-12-13 08:07:11 +08:00

31 lines
477 B
Go

package main
import (
"ais/pkg/api"
_ "embed"
"github.com/gin-gonic/gin"
)
//go:embed web/public/index.html
var indexhtml string
//go:embed web/public/ais.js
var aisjs string
func main() {
router := api.NewAPI()
router.GET("/", func(c *gin.Context) {
c.Header("Content-Type", "text/html")
c.String(200, indexhtml)
})
router.GET("/ais.js", func(c *gin.Context) {
c.Header("Content-Type", "text/javascript")
c.String(200, aisjs)
})
router.Run(":8888")
}