I want the home page to stop being available after a post request. Here is my code. Thanks in advance.
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")
}
My directory structure
-main.go
-pages
-home
-index.html