-
Notifications
You must be signed in to change notification settings - Fork 75
docs: give every template a README.md #191
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
Open
joshua-mo-143
wants to merge
6
commits into
shuttle-hq:main
Choose a base branch
from
joshua-mo-143:update-readmes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
fde7bf9
docs: give every template a README.md
joshua-mo-143 97348cc
feat: fix templates.toml
joshua-mo-143 cf09fdf
fix: typo
joshua-mo-143 b6cc267
docs: standardise readmes
joshua-mo-143 8e790ed
feat: standardize every last readme ever
joshua-mo-143 71bc067
fix: ci
joshua-mo-143 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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>. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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>. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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>. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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"}' | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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>. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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>. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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>. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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>. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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"} | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| ## Example usage | ||||||
|
|
||||||
| Run the project and visit <http://localhost:8000>. | ||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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>. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # `shuttle-cron` | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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! | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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>. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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>. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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>. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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>. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.