Files
fn-serverless/examples/middleware/README.md
2018-06-08 11:47:04 +01:00

486 B

Middleware Example

This example adds a simple authentication middleware to Fn. See main.go for example code.

Building and Running

go build
./middleware

Then test with:

# First, create an app
fn create app myapp
# And test
curl http://localhost:8080/v1/apps

You should get a 401 error.

Add an auth header and it should go through successfully:

curl -X GET -H "Authorization: Bearer KlaatuBaradaNikto" http://localhost:8080/v1/apps