pixivfe/main.go

24 lines
405 B
Go
Raw Normal View History

2023-05-13 03:34:31 +00:00
package main
import (
"net/http"
"pixivfe/handler"
2023-05-13 03:34:31 +00:00
"github.com/gin-gonic/gin"
)
func test(c *gin.Context) {
data := handler.GetRecommendedIllust(c)
c.HTML(http.StatusOK, "index.html", data)
2023-05-13 03:34:31 +00:00
}
func main() {
server := gin.Default()
server.Static("css/", "./template/css")
server.LoadHTMLGlob("template/*.html")
// Listen and Servr in 0.0.0.0:8080
server.GET("/", test)
server.Run(":8080")
2023-05-13 03:34:31 +00:00
}