Files
fn-serverless/examples/middleware/README.md
Travis Reeder 9cc12b4b12 Remove iron...
2017-05-18 18:59:34 +00:00

28 lines
501 B
Markdown

# Middleware Example
This example adds a simple authentication middleware to Oracle Functions. See [main.go](main.go) for example code.
## Building and Running
```sh
go build
./middleware
```
Then test with:
```sh
# First, create an app
fn apps create 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:
```sh
curl -X GET -H "Authorization: Bearer KlaatuBaradaNikto" http://localhost:8080/v1/apps
```