mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
* API endpoint extensions working. extensions example. extensions example. * Added server.NewEnv and some docs for the API extensions example. extensions example. extensions example. * Uncommented special handler stuff. * First example of middleware. easier to use. * Added a special Middleware context to make middleware easier to use. * Fix tests. * Cleanup based on PR comments.
23 lines
425 B
Markdown
23 lines
425 B
Markdown
# Extensions Example
|
|
|
|
This example adds extra endpoints to the API. See [main.go](main.go) for example code.
|
|
|
|
## Building and Running
|
|
|
|
```sh
|
|
go build
|
|
./extensions
|
|
```
|
|
|
|
Then test with:
|
|
|
|
```sh
|
|
# First, create an app
|
|
fn apps create myapp
|
|
# And test
|
|
curl http://localhost:8080/v1/custom1
|
|
curl http://localhost:8080/v1/custom2
|
|
curl http://localhost:8080/v1/apps/myapp/custom3
|
|
curl http://localhost:8080/v1/apps/myapp/custom4
|
|
```
|