diff --git a/examples/main.go b/examples/main.go new file mode 100644 index 0000000..75d0a59 --- /dev/null +++ b/examples/main.go @@ -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)) +}