mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
* circle * circle * circle * circle * circle * CIRCLE * circle * circle * circle * circle * circle * circle * circle * circle * circle * circle * cijrcle * circle * circle * circle * circle * c * c * circle * testing release * circle * trying release * c * c * functions: 0.3.25 release [skip ci] * c * functions: 0.3.26 release [skip ci] * fn tool: 0.3.19 release [skip ci] * testing cli release only * fn tool: 0.3.20 release [skip ci] * fn tool: 0.3.21 release [skip ci] * hopefully the last thing * fn tool: 0.3.22 release [skip ci] * c * fn tool: 0.3.23 release [skip ci] * almost there.... * fn tool: 0.3.24 release [skip ci] * fnlb: 0.0.2 release [skip ci] * fn tool: 0.3.25 release [skip ci] * fnlb: 0.0.3 release [skip ci] * Added back in commented out lines. * Fixing middleware example.
Middleware Example
This example adds a simple authentication middleware to Oracle Functions. See main.go for example code.
Building and Running
go build
./middleware
Then test with:
# 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:
curl -X GET -H "Authorization: Bearer KlaatuBaradaNikto" http://localhost:8080/v1/apps