我希望主页在发布请求后停止可用。这是我的代码。提前致谢。
package main
import(
"github.com/gin-contrib/static"
"github.com/gin-gonic/gin"
)
func main() {
r := gin.Default()
r.Use(static.Serve("/", static.LocalFile("./pages/home", true)))
r.POST("/example", func(c *gin.Context) {
//here I would like to stop serving the static files on a POST request
})
r.Run(":8080")
}
我的目录结构
-main.go
-pages
-home
-index.html
慕桂英3389331
相关分类