Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update init args, update discord weather tutorial, cleanup #91

Merged
merged 2 commits into from
May 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Shuttle Docs

## Contributing

If you found an error in our docs, or you simply want to make them better, contributions are always appreciated!

Our docs are powered by [mintlify](https://mintlify.com/). To run them for local development:
Expand Down
2 changes: 1 addition & 1 deletion configuration/shuttle-service-name.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A new Shuttle service can be named by passing in a project name as an argument a

```bash
mkdir -p url-shortener
cargo shuttle init --rocket --name url-shortener
cargo shuttle init --template rocket --name url-shortener
```

This will create a new Rocket framework based project called `url-shortener` and will populate the name field within the `[package]` section name of the generated `Cargo.toml` file.
Expand Down
6 changes: 3 additions & 3 deletions examples/actix.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Simple 'Hello world' app using Actix.
Create a new directory (`mkdir`) and move into it (`cd`) -- afterwards, execute the following command to initialize shuttle inside with the Actix boilerplate.

```bash
cargo shuttle init --actix
cargo shuttle init --template actix
```

Make sure that your `Cargo.toml` file looks like the one below -- having the right dependencies is key!
Expand Down Expand Up @@ -67,7 +67,7 @@ Simple todo app using Actix & Postgres.
Create a new directory (`mkdir`) and move into it (`cd`) -- afterwards, execute the following command to initialize shuttle inside with the Actix boilerplate.

```bash
cargo shuttle init --actix
cargo shuttle init --template actix
```

Make sure that your `Cargo.toml` file looks like the one below -- having the right dependencies is key!
Expand Down Expand Up @@ -189,7 +189,7 @@ Simple 'Hello world' app using Actix.
Create a new directory (`mkdir`) and move into it (`cd`) -- afterwards, execute the following command to initialize shuttle inside with the Actix boilerplate.

```bash
cargo shuttle init --actix
cargo shuttle init --template actix
```

Make sure that your `Cargo.toml` file looks like the one below -- having the right dependencies is key!
Expand Down
4 changes: 2 additions & 2 deletions examples/axum.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Simple 'Hello world' app using Axum.
Create a new directory (`mkdir`) and move into it (`cd`) -- afterwards, execute the following command to initialize shuttle inside with the Axum boilerplate.

```bash
cargo shuttle init --axum
cargo shuttle init --template axum
```

Make sure that your `Cargo.toml` file looks like the one below -- having the right dependencies is key!
Expand Down Expand Up @@ -62,7 +62,7 @@ A websocket example using Axum.
Create a new directory (`mkdir`) and move into it (`cd`) -- afterwards, execute the following command to initialize shuttle inside with the Axum boilerplate.

```bash
cargo shuttle init --axum
cargo shuttle init --template axum
```

Make sure that your `Cargo.toml` file looks like the one below -- having the right dependencies is key!
Expand Down
17 changes: 8 additions & 9 deletions examples/custom-service.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ To be able to create this example, we'll need to grab an API token from the [Dis
2. Navigate to the Bot tab in the lefthand menu, and add a new bot.
3. On the bot page click the Reset Token button to reveal your token. Put this token in your `Secrets.toml` (explained below). It's very important that you don't reveal your token to anyone, as it can be abused. Create a `.gitignore` file to omit your `Secrets.toml` from version control.

Your `Secrets.toml` file needs to be in the root of your directory once the project's been initialised - the file will use a format similar to a `.env` file, like so:
Your `Secrets.toml` file needs to be in the root of your directory once the project has been initialised - the file will use a format similar to a `.env` file, like so:
```toml Secrets.toml
DISCORD_TOKEN = 'the contents of my discord token'
```
Expand All @@ -28,7 +28,7 @@ To add the bot to a server, we need to create an invite link:
### Initial Setup
Start by running the following command:
```bash
cargo shuttle init --no-framework
cargo shuttle init --template none
```

This will simply initialize a new cargo crate with a dependency on `shuttle-service`.
Expand All @@ -47,9 +47,8 @@ axum = "0.6.4"
hyper = "0.14.24"
poise = "0.5.2"
serde = "1.0"
shuttle-secrets = "0.15.0"
shuttle-service = { version = "0.15.0" }
shuttle-runtime = { version = "0.15.0" }
shuttle-runtime = "0.16.0"
shuttle-secrets = "0.16.0"
tokio = "1.26.0"
```

Expand All @@ -72,12 +71,12 @@ You can only have one HTTP service bound to the `addr`, but you can start other
binding to a socket, like so:

```rust main.rs
#[shuttle_service::async_trait]
impl shuttle_service::Service for CustomService {
#[shuttle_runtime::async_trait]
impl shuttle_runtime::Service for CustomService {
async fn bind(
mut self,
addr: std::net::SocketAddr,
) -> Result<(), shuttle_service::error::Error> {
) -> Result<(), shuttle_runtime::Error> {

let router = self.router.into_inner();

Expand Down Expand Up @@ -157,7 +156,7 @@ pub struct CustomService {
#[shuttle_runtime::main]
async fn init(
#[shuttle_secrets::Secrets] secrets: SecretStore,
) -> Result<CustomService, shuttle_service::Error> {
) -> Result<CustomService, shuttle_runtime::Error> {
let discord_api_key = secrets.get("DISCORD_API_KEY").unwrap();

let discord_bot = poise::Framework::builder()
Expand Down
6 changes: 3 additions & 3 deletions examples/poem.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Simple 'Hello world' app using Poem.
Create a new directory (`mkdir`) and move into it (`cd`) -- afterwards, execute the following command to initialize shuttle inside with the Poem boilerplate.

```bash
cargo shuttle init --poem
cargo shuttle init --template poem
```

Make sure that your `Cargo.toml` file looks like the one below -- having the right dependencies is key!
Expand Down Expand Up @@ -65,7 +65,7 @@ Simple 'todo app' example using MongoDB.
Create a new directory (`mkdir`) and move into it (`cd`) -- afterwards, execute the following command to initialize shuttle inside with the Poem boilerplate.

```bash
cargo shuttle init --poem
cargo shuttle init --template poem
```

Make sure that your `Cargo.toml` file looks like the one below -- having the right dependencies is key!
Expand Down Expand Up @@ -183,7 +183,7 @@ Simple 'todo app' example using Postgres.
Create a new directory (`mkdir`) and move into it (`cd`) -- afterwards, execute the following command to initialize shuttle inside with the Poem boilerplate.

```bash
cargo shuttle init --poem
cargo shuttle init --template poem
```

Make sure that your `Cargo.toml` file looks like the one below -- having the right dependencies is key!
Expand Down
2 changes: 1 addition & 1 deletion examples/rocket.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Simple 'Hello world' app using Rocket.
Create a new directory (`mkdir`) and move into it (`cd`) -- afterwards, execute the following command to initialize shuttle inside with the Rocket boilerplate.

```bash
cargo shuttle init --rocket
cargo shuttle init --template rocket
```

Make sure that your `Cargo.toml` file looks like the one below -- having the right dependencies is key!
Expand Down
2 changes: 1 addition & 1 deletion examples/salvo.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Simple 'Hello world' app using Salvo.
Create a new directory (`mkdir`) and move into it (`cd`) -- afterwards, execute the following command to initialize shuttle inside with the Salvo boilerplate.

```bash
cargo shuttle init --salvo
cargo shuttle init --template salvo
```

Make sure that your `Cargo.toml` file looks like the one below -- having the right dependencies is key!
Expand Down
4 changes: 2 additions & 2 deletions examples/serenity.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ To add the bot to a server we need to create an invite link.
Create a new directory (`mkdir`) and move into it (`cd`) -- afterwards, execute the following command to initialize shuttle inside with the Salvo boilerplate.

```bash
cargo shuttle init --serenity
cargo shuttle init --template serenity
```

Make sure that your `Cargo.toml` file looks like the one below -- having the right dependencies is key!
Expand Down Expand Up @@ -142,7 +142,7 @@ For more information please refer to the [Discord docs](https://discord.com/deve
Create a new directory (`mkdir`) and move into it (`cd`) -- afterwards, execute the following command to initialize shuttle inside with the Salvo boilerplate.

```bash
cargo shuttle init --serenity
cargo shuttle init --template serenity
```

Make sure that your `Cargo.toml` file looks like the one below -- having the right dependencies is key!
Expand Down
4 changes: 2 additions & 2 deletions examples/thruster.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Create a new directory (`mkdir`) and move into it (`cd`) -- afterwards, execute
the following command to initialize shuttle inside with the Thruster boilerplate.

```bash
cargo shuttle init --thruster
cargo shuttle init --template thruster
```

Make sure that your `cargo.toml` file looks as the one below -- having the right
Expand Down Expand Up @@ -69,7 +69,7 @@ Create a new directory (`mkdir`) and move into it (`cd`) -- afterwards, execute
the following command to initialize shuttle inside with the Tide boilerplate.

```bash
cargo shuttle init --thruster
cargo shuttle init --template thruster
```

Make sure that your `cargo.toml` file looks as the one below -- having the right
Expand Down
4 changes: 2 additions & 2 deletions examples/tide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Simple 'Hello world' app using Tide.
Create a new directory (`mkdir`) and move into it (`cd`) -- afterwards, execute the following command to initialize shuttle inside with the Tide boilerplate.

```bash
cargo shuttle init --tide
cargo shuttle init --template tide
```

Make sure that your `Cargo.toml` file looks like the one below -- having the right dependencies is key!
Expand Down Expand Up @@ -56,7 +56,7 @@ And your app is live! 🎉🎉🎉
Create a new directory (`mkdir`) and move into it (`cd`) -- afterwards, execute the following command to initialize shuttle inside with the Tide boilerplate.

```bash
cargo shuttle init --tide
cargo shuttle init --template tide
```

Make sure that your `Cargo.toml` file looks like the one below -- having the right dependencies is key!
Expand Down
2 changes: 1 addition & 1 deletion examples/tower.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Simple 'Hello world' app using Tower.
Create a new directory (`mkdir`) and move into it (`cd`) -- afterwards, execute the following command to initialize shuttle inside with the Tower boilerplate.

```bash
cargo shuttle init --tower
cargo shuttle init --template tower
```

Make sure that your `Cargo.toml` file looks like the one below -- having the right dependencies is key!
Expand Down
2 changes: 1 addition & 1 deletion examples/warp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Simple 'Hello world' app using Warp.
Create a new directory (`mkdir`) and move into it (`cd`) -- afterwards, execute the following command to initialize shuttle inside with the Warp boilerplate.

```bash
cargo shuttle init --warp
cargo shuttle init --template warp
```

Make sure that your `Cargo.toml` file looks like the one below -- having the right dependencies is key!
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion images/discord-weather-forecast-6_files/13.650baa93.js

This file was deleted.

1 change: 0 additions & 1 deletion images/discord-weather-forecast-6_files/16.64b47fa1.js

This file was deleted.

1 change: 0 additions & 1 deletion images/discord-weather-forecast-6_files/18.01f350bb.js

This file was deleted.

1 change: 0 additions & 1 deletion images/discord-weather-forecast-6_files/2.6539ea43.js

This file was deleted.

1 change: 0 additions & 1 deletion images/discord-weather-forecast-6_files/20.b27624c6.js

This file was deleted.

1 change: 0 additions & 1 deletion images/discord-weather-forecast-6_files/21.b5e9e8d2.js

This file was deleted.

1 change: 0 additions & 1 deletion images/discord-weather-forecast-6_files/22.21346678.js

This file was deleted.

Loading