mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Address broken tests
This commit is contained in:
committed by
James Jeffrey
parent
04008c71fd
commit
31b4ac4516
@@ -58,7 +58,7 @@ Note: Route level configuration overrides app level configuration.
|
||||
Using `fn`:
|
||||
|
||||
```sh
|
||||
fn routes create myapp /path --config k1=v1 --config k2=v2 --image treeder/hello
|
||||
fn routes create myapp /path --config k1=v1 --config k2=v2 --image funcy/hello
|
||||
```
|
||||
|
||||
Or using cURL:
|
||||
@@ -80,7 +80,7 @@ curl -H "Content-Type: application/json" -X POST -d '{
|
||||
```json
|
||||
{
|
||||
"path": "/hello",
|
||||
"image": "treeder/hello",
|
||||
"image": "funcy/hello",
|
||||
"type": "sync",
|
||||
"memory": 128,
|
||||
"config": {
|
||||
|
||||
@@ -10,7 +10,7 @@ The files can be named as:
|
||||
An example of a function file:
|
||||
|
||||
```yaml
|
||||
name: treeder/hello
|
||||
name: funcy/hello
|
||||
version: 0.0.1
|
||||
type: sync
|
||||
memory: 128
|
||||
|
||||
@@ -45,8 +45,8 @@ $ export FUNCTIONS=$(docker port functions | cut -d ' ' -f3)
|
||||
$ curl -H "Content-Type: application/json" -X POST -d '{ "app": { "name":"myapp" } }' http://$FUNCTIONS/v1/apps
|
||||
{"message":"App successfully created","app":{"name":"myapp","config":null}}
|
||||
|
||||
$ curl -H "Content-Type: application/json" -X POST -d '{ "route": { "type": "sync", "path":"/hello-sync", "image":"treeder/hello" } }' http://$FUNCTIONS/v1/apps/myapp/routes
|
||||
{"message":"Route successfully created","route":{"app_name":"myapp","path":"/hello-sync","image":"treeder/hello","memory":128,"type":"sync","config":null}}
|
||||
$ curl -H "Content-Type: application/json" -X POST -d '{ "route": { "type": "sync", "path":"/hello-sync", "image":"funcy/hello" } }' http://$FUNCTIONS/v1/apps/myapp/routes
|
||||
{"message":"Route successfully created","route":{"app_name":"myapp","path":"/hello-sync","image":"funcy/hello","memory":128,"type":"sync","config":null}}
|
||||
|
||||
$ curl -H "Content-Type: application/json" -X POST -d '{ "name":"Johnny" }' http://$FUNCTIONS/r/myapp/hello-sync
|
||||
Hello Johnny!
|
||||
@@ -125,8 +125,8 @@ $ export FUNCTIONS=$(docker port functions-lb | cut -d ' ' -f3)
|
||||
$ curl -H "Content-Type: application/json" -X POST -d '{ "app": { "name":"myapp" } }' http://$FUNCTIONS/v1/apps
|
||||
{"message":"App successfully created","app":{"name":"myapp","config":null}}
|
||||
|
||||
$ curl -H "Content-Type: application/json" -X POST -d '{ "route": { "type": "sync", "path":"/hello-sync", "image":"treeder/hello" } }' http://$FUNCTIONS/v1/apps/myapp/routes
|
||||
{"message":"Route successfully created","route":{"app_name":"myapp","path":"/hello-sync","image":"treeder/hello","memory":128,"type":"sync","config":null}}
|
||||
$ curl -H "Content-Type: application/json" -X POST -d '{ "route": { "type": "sync", "path":"/hello-sync", "image":"funcy/hello" } }' http://$FUNCTIONS/v1/apps/myapp/routes
|
||||
{"message":"Route successfully created","route":{"app_name":"myapp","path":"/hello-sync","image":"funcy/hello","memory":128,"type":"sync","config":null}}
|
||||
|
||||
$ curl -H "Content-Type: application/json" -X POST -d '{ "name":"Johnny" }' http://$FUNCTIONS/r/myapp/hello-sync
|
||||
Hello Johnny!
|
||||
|
||||
@@ -49,8 +49,8 @@ $ export FUNCTIONS=$(kubectl get -o json svc functions | jq -r '.status.loadBala
|
||||
$ curl -H "Content-Type: application/json" -X POST -d '{ "app": { "name":"myapp" } }' http://$FUNCTIONS/v1/apps
|
||||
{"message":"App successfully created","app":{"name":"myapp","config":null}}
|
||||
|
||||
$ curl -H "Content-Type: application/json" -X POST -d '{ "route": { "type": "sync", "path":"/hello-sync", "image":"treeder/hello" } }' http://$FUNCTIONS/v1/apps/myapp/routes
|
||||
{"message":"Route successfully created","route":{"app_name":"myapp","path":"/hello-sync","image":"treeder/hello","memory":128,"type":"sync","config":null}}
|
||||
$ curl -H "Content-Type: application/json" -X POST -d '{ "route": { "type": "sync", "path":"/hello-sync", "image":"funcy/hello" } }' http://$FUNCTIONS/v1/apps/myapp/routes
|
||||
{"message":"Route successfully created","route":{"app_name":"myapp","path":"/hello-sync","image":"funcy/hello","memory":128,"type":"sync","config":null}}
|
||||
|
||||
$ curl -H "Content-Type: application/json" -X POST -d '{ "name":"Johnny" }' http://$FUNCTIONS/r/myapp/hello-sync
|
||||
Hello Johnny!
|
||||
@@ -102,8 +102,8 @@ $ export FUNCTIONS=$(kubectl get -o json svc functions | jq -r '.status.loadBala
|
||||
$ curl -H "Content-Type: application/json" -X POST -d '{ "app": { "name":"myapp" } }' http://$FUNCTIONS/v1/apps
|
||||
{"message":"App successfully created","app":{"name":"myapp","config":null}}
|
||||
|
||||
$ curl -H "Content-Type: application/json" -X POST -d '{ "route": { "type": "sync", "path":"/hello-sync", "image":"treeder/hello" } }' http://$FUNCTIONS/v1/apps/myapp/routes
|
||||
{"message":"Route successfully created","route":{"app_name":"myapp","path":"/hello-sync","image":"treeder/hello","memory":128,"type":"sync","config":null}}
|
||||
$ curl -H "Content-Type: application/json" -X POST -d '{ "route": { "type": "sync", "path":"/hello-sync", "image":"funcy/hello" } }' http://$FUNCTIONS/v1/apps/myapp/routes
|
||||
{"message":"Route successfully created","route":{"app_name":"myapp","path":"/hello-sync","image":"funcy/hello","memory":128,"type":"sync","config":null}}
|
||||
|
||||
$ curl -H "Content-Type: application/json" -X POST -d '{ "name":"Johnny" }' http://$FUNCTIONS/r/myapp/hello-sync
|
||||
Hello Johnny!
|
||||
|
||||
@@ -56,7 +56,7 @@ some container configuration values.
|
||||
curl -H "Content-Type: application/json" -X POST -d '{
|
||||
"route": {
|
||||
"path":"/hello",
|
||||
"image":"treeder/hello",
|
||||
"image":"funcy/hello",
|
||||
"memory": 100,
|
||||
"type": "sync",
|
||||
"config": {"APPLOG": "stderr"}
|
||||
|
||||
@@ -25,12 +25,12 @@ Now that we have an app, we can route endpoints to functions.
|
||||
### Add a Route
|
||||
|
||||
A route is a way to define a path in your application that maps to a function. In this example, we'll map
|
||||
`/hello` to a simple `Hello World!` function called `treeder/hello` which is a function we already made that you
|
||||
`/hello` to a simple `Hello World!` function called `funcy/hello` which is a function we already made that you
|
||||
can use -- yes, you can share functions! The source code for this function is in the [examples directory](examples/hello/go).
|
||||
You can read more about [writing your own functions here](docs/writing.md).
|
||||
|
||||
```sh
|
||||
fn routes create myapp /hello -i treeder/hello
|
||||
fn routes create myapp /hello -i funcy/hello
|
||||
```
|
||||
|
||||
Or using cURL:
|
||||
@@ -39,7 +39,7 @@ Or using cURL:
|
||||
curl -H "Content-Type: application/json" -X POST -d '{
|
||||
"route": {
|
||||
"path":"/hello",
|
||||
"image":"treeder/hello"
|
||||
"image":"funcy/hello"
|
||||
}
|
||||
}' http://localhost:8080/v1/apps/myapp/routes
|
||||
```
|
||||
@@ -101,7 +101,7 @@ curl -H "Content-Type: application/json" -X POST -d '{
|
||||
"route": {
|
||||
"type": "async",
|
||||
"path":"/hello-async",
|
||||
"image":"treeder/hello"
|
||||
"image":"funcy/hello"
|
||||
}
|
||||
}' http://localhost:8080/v1/apps/myapp/routes
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user