mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Update CLI docs to reflect new CLI verb/noun structure (#1031)
Use new CLI syntax
This commit is contained in:
@@ -9,7 +9,7 @@ Applications are the top level object that groups routes together to create an A
|
||||
Using `fn`:
|
||||
|
||||
```sh
|
||||
fn apps create --config k1=v1 --config k2=v2 myapp
|
||||
fn create app --config k1=v1 --config k2=v2 myapp
|
||||
```
|
||||
|
||||
Or using a cURL:
|
||||
@@ -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 fnproject/hello
|
||||
fn create route myapp /path --config k1=v1 --config k2=v2 --image fnproject/hello
|
||||
```
|
||||
|
||||
Or using cURL:
|
||||
|
||||
@@ -6,7 +6,7 @@ These are ordered in order of preference, the later ones overriding the previous
|
||||
## 1. Application level configuration
|
||||
|
||||
```sh
|
||||
fn apps config set myapp LOG_LEVEL debug
|
||||
fn config app myapp LOG_LEVEL debug
|
||||
```
|
||||
|
||||
## 2. Function configuration from func.yaml
|
||||
@@ -16,5 +16,5 @@ See [Function file](function-file.md) for more info.
|
||||
## 3. Route level configuration
|
||||
|
||||
```sh
|
||||
fn routes config set myapp hello2 LOG_LEVEL info
|
||||
fn config route myapp hello2 LOG_LEVEL info
|
||||
```
|
||||
|
||||
@@ -7,7 +7,7 @@ This is a more detailed explanation of the main commands you'll use in Fn as a d
|
||||
An application is essentially a grouping of functions, that put together, form an API. Here's how to create an app.
|
||||
|
||||
```sh
|
||||
fn apps create myapp
|
||||
fn create app myapp
|
||||
```
|
||||
|
||||
Or using a cURL:
|
||||
@@ -29,7 +29,7 @@ A route is a way to define a path in your application that maps to a function. I
|
||||
can use -- yes, you can share functions! The source code for this function is in the [examples directory](/examples/hello/go).
|
||||
|
||||
```sh
|
||||
fn routes create myapp /hello -i fnproject/hello
|
||||
fn create route myapp /hello -i fnproject/hello
|
||||
```
|
||||
|
||||
Or using cURL:
|
||||
|
||||
@@ -34,7 +34,7 @@ This will create a docker image and push the image to docker.
|
||||
## Publishing to Fn
|
||||
|
||||
```bash
|
||||
fn routes create <app_name> </path>
|
||||
fn create route <app_name> </path>
|
||||
```
|
||||
|
||||
This creates a full path in the form of `http://<host>:<port>/r/<app_name>/<function>`
|
||||
|
||||
@@ -22,8 +22,8 @@ cat post.json | fn run -e DB_USER=root -e DB_PASS=pass posts/create
|
||||
fn run -e DB_USER=root -e DB_PASS=pass posts
|
||||
|
||||
# Set app configs
|
||||
fn apps config set blog DB_USER root
|
||||
fn apps config set blog DB_PASS pass
|
||||
fn config app blog DB_USER root
|
||||
fn config app blog DB_PASS pass
|
||||
|
||||
# fn deploy it!
|
||||
fn deploy --all
|
||||
|
||||
@@ -17,11 +17,11 @@ fn build
|
||||
fn deploy --local --app spring-cloud-fn
|
||||
|
||||
# Set up a couple of routes for different functions
|
||||
fn routes create spring-cloud-fn /upper
|
||||
fn routes config set spring-cloud-fn /upper FN_SPRING_FUNCTION upperCase
|
||||
fn create route spring-cloud-fn /upper
|
||||
fn config route spring-cloud-fn /upper FN_SPRING_FUNCTION upperCase
|
||||
|
||||
fn routes create spring-cloud-fn /lower
|
||||
fn routes config set spring-cloud-fn /lower FN_SPRING_FUNCTION lowerCase
|
||||
fn create route spring-cloud-fn /lower
|
||||
fn config route spring-cloud-fn /lower FN_SPRING_FUNCTION lowerCase
|
||||
```
|
||||
|
||||
Now you can call those functions using `fn call` or curl:
|
||||
|
||||
@@ -13,7 +13,7 @@ Then test with:
|
||||
|
||||
```sh
|
||||
# First, create an app
|
||||
fn apps create myapp
|
||||
fn create app myapp
|
||||
# And test
|
||||
curl http://localhost:8080/v1/apps
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user