2023-05-13 03:34:31 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
2023-05-13 10:03:13 +00:00
|
|
|
"pixivfe/handler"
|
2023-05-13 03:34:31 +00:00
|
|
|
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
)
|
|
|
|
|
2023-05-13 10:03:13 +00:00
|
|
|
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() {
|
2023-05-13 10:03:13 +00:00
|
|
|
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
|
|
|
}
|