Skip to content

Commit 338924e

Browse files
committed
Variables
Signed-off-by: itowlson <ivan.towlson@fermyon.com>
1 parent 9e11fd7 commit 338924e

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

content/v4/redis-trigger.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ You can use [application variables](./variables.md#adding-variables-to-your-appl
5353

5454
## Redis Trigger Authentication
5555

56-
By default, Spin does not authenticate to Redis. You can work around this by providing a password in the `redis://` URL. For example: `address = "redis://:{{ password }}@localhost:6379"`. Here `password` is an [application variable](./variables.md#adding-variables-to-your-applications) as mentioned above.
56+
By default, Spin does not authenticate to Redis. You can work around this by providing a password in the `redis://` URL. For example: `address = "redis://:\{{ password }}@localhost:6379"`. Here `password` is an [application variable](./variables.md#adding-variables-to-your-applications) as mentioned above.
5757

5858
> Do not hard-code passwords in code committed to version control systems.
5959

content/v4/variables.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ component = "api-consumer"
8383
source = "app.wasm"
8484
[component.api-consumer.variables]
8585
token = "\{{ api_token }}"
86-
api_uri = "\{{ api_uri }}
86+
api_uri = "\{{ api_uri }}"
8787
api_version = "v1"
8888
```
8989

9090
## Using Variables From Applications
9191

92-
The Spin SDK surfaces the Spin configuration interface to your language. The [interface](https://github.com/spinframework/spin/blob/main/wit/deps/spin@2.0.0/variables.wit) consists of one operation:
92+
The Spin SDK surfaces the Spin configuration interface to your language. The [interface](https://github.com/spinframework/spin/blob/main/wit/deps/spin-variables%403.0.0/variables.wit) consists of one operation:
9393

9494
| Operation | Parameters | Returns | Behavior |
9595
|------------|--------------------|---------------------|----------|
@@ -123,7 +123,7 @@ async fn handle_api_call_with_token(_req: Request) -> anyhow::Result<impl IntoRe
123123
.method(Method::Get)
124124
.uri(versioned_api_uri)
125125
.header("Authorization", format!("Bearer {}", token))
126-
.body(EmptyBody::new());
126+
.body(EmptyBody::new())?;
127127
let response: Response = spin_sdk::http::send(request).await?;
128128
// Do something with the response ...
129129
Ok(Response::builder()
@@ -338,4 +338,4 @@ If you run into the following error, you've most likely not configured the compo
338338
Handler returned an error: Error::Undefined("no variable for \"<component-id>\".\"your-variable\"")
339339
```
340340

341-
To fix this, edit the `spin.toml` and add to the `[component.<component-id>.variables]` table a line such as `<your-variable> = "{{ app-variable }}".` See [above](#adding-variables-to-your-applications) for more information.
341+
To fix this, edit the `spin.toml` and add to the `[component.<component-id>.variables]` table a line such as `<your-variable> = "\{{ app-variable }}".` See [above](#adding-variables-to-your-applications) for more information.

0 commit comments

Comments
 (0)