Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 5 additions & 0 deletions actix-web/hello-world/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
A `Hello world!` example for using Actix Web with Shuttle.

## Example usage

Run the app and go to <http://localhost:8000>.
5 changes: 5 additions & 0 deletions axum/hello-world/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
A `Hello world!` example for using Axum with Shuttle.

## Example usage

Run the app and go to <http://localhost:8000>.
5 changes: 5 additions & 0 deletions axum/metadata/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
An example that showcases Shuttle metadata at the base route using Axum.

## Example usage

Run the app and go to <http://localhost:8000>.
11 changes: 11 additions & 0 deletions axum/turso/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
An example that showcases using Turso with Axum and Shuttle.

## Example usage

Set your `TURSO_DB_TOKEN` in Secrets.toml and Turso database in `src/main.rs` in the annotation.

Run the app, then try it out with the following `curl` command:

```sh
curl http://localhost:8000 -H 'content-type: application/json' --data '{"uid":"1","email":"foo@bar.xyz"}'
```
5 changes: 5 additions & 0 deletions axum/websocket/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This template shows how to use websockets with Axum in a Shuttle project.

## Example usage

Run the project and visit <http://localhost:8000> to try it out.
5 changes: 5 additions & 0 deletions custom-resource/pdo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This template shows how to create your own custom Shuttle resource in a Shuttle project, using Axum for the `main.rs` file to set up the router.

## Example usage

Run the project and visit <http://localhost:8000>.
7 changes: 7 additions & 0 deletions custom-service/none/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
This template shows how to create your own custom Shuttle service that can run anything HTTP-based.

## Example usage

Set up whatever you want to do in the `bind()` function, then visit <http://localhost:8000> (or your relevant routes) to try it out.

Variables from resource annotations can be added to `MyService` struct to use them in the `bind()` function.
5 changes: 5 additions & 0 deletions other/feature-flags/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
An example that showcases how to use feature flags with Shuttle (see `Cargo.toml`).

## Example usage

Run the project and visit <http://localhost:8000>.
5 changes: 5 additions & 0 deletions poem/hello-world/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
An example that showcases using the `poem` web service framework with Shuttle.

## Example usage

Run the project and visit <http://localhost:8000>.
5 changes: 5 additions & 0 deletions rocket/hello-world/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
An example that showcases using the `rocket` web service framework with Shuttle.

## Example usage

Run the project and visit <http://localhost:8000>.
13 changes: 13 additions & 0 deletions rocket/postgres/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Shuttle shared Postgres DB with Rocket

This template shows how to connect a Postgres database and use it for a simple TODO list app.

## Example usage

```bash
curl -X POST -H 'content-type: application/json' localhost:8000/todo --data '{"note":"My todo"}'
# {"id":1,"note":"My todo"}

curl localhost:8000/todos/1
# {"id":1,"note":"My todo"}
```
3 changes: 3 additions & 0 deletions rocket/static-files/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Serving Static Assets with Rocket

This example shows how to serve static assets using [axum](https://github.com/rwf2/rocket) and Shuttle.
5 changes: 5 additions & 0 deletions rocket/workspace/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This example shows how to use a Cargo workspace with Shuttle using the `rocket` web service frameowrk.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This example shows how to use a Cargo workspace with Shuttle using the `rocket` web service frameowrk.
This example shows how to use a Cargo workspace with Shuttle using the `rocket` web service framework.


## Example usage

Run the project and visit <http://localhost:8000>.
5 changes: 5 additions & 0 deletions salvo/hello-world/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
An example that showcases using the `salvo` web service framework with Shuttle.

## Example usage

Run the project and visit <http://localhost:8000>.
16 changes: 16 additions & 0 deletions shuttle-cron/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# `shuttle-cron`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't use inline code in title


A service that prints out a log message at specified cron-style intervals.

This example uses the `apalis` framework to be able to carry out cronjobs. A struct is defined that has some given data in it, and is stored in the Apalis monitor. We also implement a struct that holds a `chrono::DateTime<chrono::Utc>`, which `apalis` uses internally for cron job streaming.

When the cron job is called, the data is grabbed from the `JobContext` and we then execute the job.

The actual function to be ran itself is stored in `job_fn()` in the main function, as a function pointer.

# Usage
Run `shuttle run` to spin up the service locally.

You can change the behavior of the cronjob by editing the `execute()` function for `CronjobData`.

Note that the run method doesn't have to be an implementation method for `CronjobData` - you can write your own!
2 changes: 1 addition & 1 deletion templates.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ template = "axum"
[starters.bevy-hello-world]
title = "Bevy"
description = "Data driven game engine that compiles to WASM"
path = "bevy/hello-world"
path = "bevy/hello-world/"
use_cases = ["Web app", "Game"]
tags = ["bevy", "axum"]

Expand Down
5 changes: 5 additions & 0 deletions thruster/hello-world/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
An example that showcases using the `thruster` web service framework with Shuttle.

## Example usage

Run the project and visit <http://localhost:8000>.
5 changes: 5 additions & 0 deletions tide/hello-world/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
An example that showcases using the `tide` web service framework with Shuttle.

## Example usage

Run the project and visit <http://localhost:8000>.
5 changes: 5 additions & 0 deletions tower/hello-world/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
An example that showcases using the `tower` web service framework (with `hyper`) with Shuttle.

## Example usage

Run the project and visit <http://localhost:8000>.
10 changes: 10 additions & 0 deletions tracing/custom-tracing-subscriber/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
An example that showcases using a custom `tracing-subscriber` with Shuttle.

Notes:
- `default-features` is disabled on `shuttle-runtime` crate to allow this to be possible

## Example usage

Run the project and visit <http://localhost:8000>.

You can also additionally adjust the custom tracing subscriber as you want.
5 changes: 5 additions & 0 deletions warp/hello-world/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
An example that showcases using the `warp` web service framework (with `hyper`) with Shuttle.

## Example usage

Run the project and visit <http://localhost:8000>.