Skip to content

Commit d4fd6cf

Browse files
committed
docs(srv): update doc on testing resource
1 parent 7b23976 commit d4fd6cf

File tree

4 files changed

+22
-12
lines changed

4 files changed

+22
-12
lines changed

pages/serverless-containers/how-to/test-a-container.mdx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ import Requirements from '@macros/iam/requirements.mdx'
1111

1212
This page shows you how to execute Serverless Containers from the [Scaleway console](https://console.scaleway.com). The **Test** feature of a container allows you to run your code using a selection of methods to make sure it behaves as expected.
1313

14-
<Message type="note">
15-
Testing **Private** Serverless Functions is not possible using the Scaleway console due to CORS limitations. Refer to the [dedicated documentation](/serverless-containers/how-to/create-auth-token-from-console/) for more information on how to secure and test a private function.
16-
</Message>
17-
1814
<Requirements />
1915

2016
- A Scaleway account logged into the [console](https://console.scaleway.com)
@@ -37,6 +33,15 @@ Testing **Private** Serverless Functions is not possible using the Scaleway cons
3733

3834
8. Copy the generated command, then execute it in a terminal.
3935

36+
<Message type="note">
37+
Testing a private container requires you use an [authentication token](/serverless-containers/how-to/create-auth-token-from-console/) as a header, as shown below:
38+
39+
```bash
40+
export $TOKEN=<YOUR_AUTH_TOKEN>
41+
curl -H "X-Auth-Token: $TOKEN" \ <YOUR_FUNCTION_ENDPOINT>
42+
````
43+
</Message>
44+
4045
The output of your terminal displays the response from your container, and the status code.
4146

4247
<Message type="note">

pages/serverless-containers/troubleshooting/tests-fail-on-container.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@ I get error messages when testing Serverless Containers using the Scaleway Conso
2121

2222
- Make sure you have created an [authentication token](/serverless-containers/how-to/create-auth-token-from-console/) for your private function, then execute a `curl` request from a terminal, as shown below:
2323
```bash
24-
curl -H "X-Auth-Token: <YOUR_AUTH_TOKEN>" \ <YOUR_CONTAINER_ENDPOINT>
24+
export $TOKEN=<YOUR_AUTH_TOKEN>
25+
curl -H "X-Auth-Token: $TOKEN" \ <YOUR_CONTAINER_ENDPOINT>
2526
```

pages/serverless-functions/how-to/test-a-function.mdx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ import Requirements from '@macros/iam/requirements.mdx'
1111

1212
This page shows you how to execute Serverless Functions from the [Scaleway console](https://console.scaleway.com). The **Test** feature of a function allows you to run your code using a selection of methods to make sure it behaves as expected.
1313

14-
<Message type="note">
15-
Testing **Private** Serverless Functions is not possible using the Scaleway console due to CORS limitations. Refer to the [dedicated documentation](/serverless-functions/how-to/create-auth-token-from-console/) for more information on how to secure and test a private function.
16-
</Message>
17-
1814
<Requirements />
1915

2016
- A Scaleway account logged into the [console](https://console.scaleway.com)
@@ -37,9 +33,16 @@ Testing **Private** Serverless Functions is not possible using the Scaleway cons
3733

3834
8. Copy the generated command, then execute it in a terminal.
3935

40-
The output of your terminal displays the response from your function, and the status code.
36+
<Message type="note">
37+
Testing a private function requires you use an [authentication token](/serverless-functions/how-to/create-auth-token-from-console/) as a header, as shown below:
4138

42-
The **Output** section displays the response from your function and the status code.
39+
```bash
40+
export $TOKEN=<YOUR_AUTH_TOKEN>
41+
curl -H "X-Auth-Token: $TOKEN" \ <YOUR_FUNCTION_ENDPOINT>
42+
````
43+
</Message>
44+
45+
The output of your terminal displays the response from your function, and the status code.
4346

4447
<Message type="note">
4548
If you encounter a message error while testing your function, refer to the [dedicated troubleshooting](/serverless-functions/troubleshooting/tests-fail-on-function/) for more information.

pages/serverless-functions/troubleshooting/tests-fail-on-function.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@ I get error messages when testing Serverless Functions using the Scaleway Consol
2121

2222
- Make sure you have created an [authentication token](/serverless-functions/how-to/create-auth-token-from-console/) for your private function, then execute a `curl` request from a terminal, as shown below:
2323
```bash
24-
curl -H "X-Auth-Token: <YOUR_AUTH_TOKEN>" \ <YOUR_FUNCTION_ENDPOINT>
24+
export $TOKEN=<YOUR_AUTH_TOKEN>
25+
curl -H "X-Auth-Token: $TOKEN" \ <YOUR_FUNCTION_ENDPOINT>
2526
```

0 commit comments

Comments
 (0)