Skip to content

Commit 9c4eee6

Browse files
committed
Moar bits
Signed-off-by: itowlson <ivan.towlson@fermyon.com>
1 parent f5f11ad commit 9c4eee6

3 files changed

Lines changed: 10 additions & 72 deletions

File tree

content/v4/kv-store-api-guide.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ The exact detail of calling these operations from your application depends on yo
4545
Key value functions are available in the `spin_sdk::key_value` module. The function names match the operations above. For example:
4646

4747
```rust
48-
use anyhow::Result;
4948
use bytes::Bytes;
5049
use spin_sdk::{
5150
http::{FullBody, IntoResponse, Request, Response},
5251
http_service,
53-
key_value::{Store},
52+
key_value::Store,
5453
};
54+
5555
#[http_service]
56-
async fn handle_request(_req: Request) -> Result<impl IntoResponse> {
56+
async fn handle_request(_req: Request) -> anyhow::Result<impl IntoResponse> {
5757
let store = Store::open_default().await?;
5858
store.set("mykey", b"myvalue").await?;
5959
let value = store.get("mykey").await?;

content/v4/mqtt-outbound.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ MQTT functions are available in the `spin_sdk::mqtt` module.
3939
To access an MQTT server, use the `Connection::open` function.
4040

4141
```rust
42-
let connection = spin_sdk::mqtt::Connection::open(&address, &username, &password, keep_alive_secs)?;
42+
let connection = spin_sdk::mqtt::Connection::open(&address, &username, &password, keep_alive_secs).await?;
4343
```
4444

4545
You can then call the `Connection::publish` function to send MQTT messages:
4646

4747
```rust
4848
let cat_picture: Vec<u8> = request.body().to_vec();
49-
connection.publish("pets", &cat_picture, spin_sdk::mqtt::Qos::AtLeastOnce)?;
49+
connection.publish("pets", &cat_picture, spin_sdk::mqtt::Qos::AtLeastOnce).await?;
5050
```
5151

5252
For full details of the MQTT API, see the [Spin SDK reference documentation](https://docs.rs/spin-sdk/latest/spin_sdk/mqtt/index.html);

content/v4/quickstart.md

Lines changed: 5 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ keywords = "quickstart"
1515
- [Structure of a Python Component](#structure-of-a-python-component)
1616
- [Build Your Application](#build-your-application)
1717
- [Run Your Application](#run-your-application)
18-
- [Deploy Your Application to Fermyon Cloud](#deploy-your-application-to-fermyon-cloud)
19-
- [Log in to Fermyon Cloud](#log-in-to-fermyon-cloud)
20-
- [Deploy the Application](#deploy-the-application)
2118
- [Next Steps](#next-steps)
2219

2320
Let's get Spin and take it from nothing to a "hello world" application!
@@ -683,7 +680,7 @@ Executing the build command for component hello-rust: cargo build --target wasm3
683680
Compiling anyhow v1.0.69
684681
Compiling version_check v0.9.4
685682
# ...
686-
Compiling spin-sdk v0.10.0
683+
Compiling spin-sdk v6.0.0
687684
Compiling hello-rust v0.1.0 (/home/ivan/testing/start/hello_rust)
688685
Finished release [optimized] target(s) in 11.94s
689686
Finished building all Spin components
@@ -693,9 +690,7 @@ If the build fails, check:
693690

694691
* Are you in the `hello_rust` directory?
695692
* Did you successfully [install the `wasm32-wasip2` target](#install-the-tools)?
696-
* Is your version of Rust up to date (`cargo --version`)? The Spin SDK needs Rust 1.78 or above.
697-
698-
> The Rust target used to be called `wasm32-wasi` (without the `p1`). Even if you already installed the old target, you'll need to install the new one!
693+
* Is your version of Rust up to date (`cargo --version`)? The Spin SDK needs Rust 1.91 or above.
699694

700695
If you would like to know what build command Spin runs for a component, you can find it in the manifest, in the `component.(id).build` section:
701696

@@ -759,7 +754,7 @@ You can always run this command manually; `spin build` is a shortcut.
759754

760755
As a standard practice for Python, create and activate a virtual env:
761756

762-
If you are on a Mac/linux based operating system use the following commands:
757+
If you are on a Mac/Linux based operating system use the following commands:
763758

764759
```bash
765760
$ python3 -m venv venv
@@ -877,7 +872,7 @@ content-type: text/plain
877872
content-length: 14
878873
date = "2023-11-04T00:00:01Z"
879874

880-
Hello, Fermyon
875+
Hello, Spin
881876
```
882877

883878
> The `curl` output may vary based on which language SDK you use.
@@ -886,65 +881,8 @@ You'll also see any logging (stdout/stderr) from the generated code printed to t
886881

887882
Congratulations! You just created, built and ran your first Spin application!
888883

889-
## Deploy Your Application to Fermyon Cloud
890-
891-
`spin up` runs your application locally. Now it's time to put it on the Web via [Fermyon Cloud](https://cloud.fermyon.com).
892-
893-
> Fermyon Cloud's Starter tier is free, and doesn't require you to enter any kind of payment instrument. You only need a [GitHub account](https://docs.github.com/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-email-preferences/remembering-your-github-username-or-email).
894-
895-
### Log in to Fermyon Cloud
896-
897-
Before deploying your application to Fermyon Cloud, you have to log in, using the `spin login` command. This generates a code to authorize your current device against the Fermyon Cloud, and prints a link that will take you to where you enter the code. (You will need to be logged into your GitHub account; if you're not, it will prompt you to log in.) Follow the instructions in the prompt to complete the authorization process.
898-
899-
`spin login` prints a confirmation message when authorization completes:
900-
901-
<!-- @selectiveCpy -->
902-
903-
```bash
904-
$ spin login
905-
906-
Copy your one-time code:
907-
908-
XXXXXXXX
909-
910-
...and open the authorization page in your browser:
911-
912-
https://cloud.fermyon.com/device-authorization
913-
914-
Waiting for device authorization...
915-
Device authorized!
916-
```
917-
918-
### Deploy the Application
919-
920-
Now let's deploy the application:
921-
922-
<!-- @selectiveCpy -->
923-
924-
```bash
925-
$ spin deploy
926-
```
927-
928-
The deployment process prints progress information as your application uploads and is rolled out to the cloud:
929-
930-
<!-- @nocpy -->
931-
932-
```console
933-
Uploading hello_typescript version 0.1.0+XXXXXXXX to Fermyon Cloud...
934-
Deploying...
935-
Waiting for application to become ready... ready
936-
Available Routes:
937-
hello-typescript: https://hello-typescript-XXXXXXXX.fermyon.app (wildcard)
938-
```
939-
940-
You can Ctrl+Click on the link in the terminal to visit the web application you just deployed.
941-
942-
> In the example output above, `hello_typescript` is a placeholder for your application name - you'll see whatever you entered as the application name when you ran `spin new` earlier. The `XXXXXXXX` fragment is randomly generated to make a unique URL.
943-
944-
Congratulations again - you've now deployed your first Spin application to [Fermyon Cloud](https://cloud.fermyon.com)!
945-
946884
## Next Steps
947885

948886
- Learn more about [writing Spin components and manifests](writing-apps)
949887
- Learn how to [build your Spin application code](build)
950-
- Learn more about [Fermyon Cloud](https://developer.fermyon.com/cloud)
888+
- Learn how to [deploy your application to a cloud host](deploying)

0 commit comments

Comments
 (0)