From f73d4f7ec1ca833f8e87bdc0673f4476987b667a Mon Sep 17 00:00:00 2001 From: Timo Hocker Date: Sat, 14 Mar 2020 12:38:40 +0100 Subject: [PATCH] add readme for exceptions --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 0265a9d..8da7613 100644 --- a/README.md +++ b/README.md @@ -31,3 +31,12 @@ app.use(auth((user_name) => { when a client logs in, it will set a header called 'session' that the client can use to authorize the following requests. it also sets a cookie to make requesting from the client more simple. (cookie parser is needed to make authentication with cookies possible) + +## Excluding routes + +exceptions to the auth module can be added by adding an array of regular expressions +a specific method can also be filtered for by giving an object instead of a plain regular expression. + +```js +auth(..., [/no-auth/, {regex: '/no-auth-post/', method: 'POST'}]); +``` \ No newline at end of file