Add examples directory

This commit is contained in:
Ivan 2025-06-26 11:07:20 +05:00
parent c1b1805c6a
commit d1eb3b1485
Signed by: landlord
GPG key ID: 416A03BC4ADA4CD7

18
examples/main.go Normal file
View file

@ -0,0 +1,18 @@
package main
import (
"net/http"
"code.app-house.ru/go/csrf"
)
func main() {
r := http.NewServeMux()
csrfProtection := csrf.New()
// You can change field or header name (as well as other settings):
// csrfProtection.FormFieldName = "foo"
// csrfProtection.HeaderName = "bar"
http.ListenAndServe(":8000", csrfProtection.Middleware(r))
}