Skip to content

Commit

Permalink
docs: adding --api
Browse files Browse the repository at this point in the history
docs: adding --api
  • Loading branch information
kaplanelad authored Oct 14, 2024
1 parent 8440f3c commit aac4b9e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions docs-site/content/blog/axum-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl Hooks for App {
Now, you can create your controller that uses Axum session. Use the `cargo loco generate controller` command:

```sh
❯ cargo loco generate controller mysession -k api
❯ cargo loco generate controller mysession --api
Finished dev [unoptimized + debuginfo] target(s) in 0.36s
Running `target/debug/axum-session-cli generate controller mysession`
added: "src/controllers/mysession.rs"
Expand Down Expand Up @@ -166,7 +166,7 @@ impl Hooks for App {
Create the controller as before using `cargo loco generate controller`

```sh
❯ cargo loco generate controller mysession -k api
❯ cargo loco generate controller mysession --api
Finished dev [unoptimized + debuginfo] target(s) in 0.36s
Running `target/debug/axum-session-cli generate controller mysession`
added: "src/controllers/mysession.rs"
Expand Down
6 changes: 3 additions & 3 deletions docs-site/content/docs/getting-started/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ The built in <code>_health</code> route will tell you that you have configured y
Let's add a quick _hello_ response to our service.

```sh
$ cargo loco generate controller guide -k api
$ cargo loco generate controller guide --api
added: "src/controllers/guide.rs"
injected: "src/controllers/mod.rs"
injected: "src/app.rs"
Expand Down Expand Up @@ -465,7 +465,7 @@ $ cargo playground
We're now ready to plug this into an `articles` controller. First, generate a new controller:
```sh
$ cargo loco generate controller articles -k api
$ cargo loco generate controller articles --api
added: "src/controllers/articles.rs"
injected: "src/controllers/mod.rs"
injected: "src/app.rs"
Expand Down Expand Up @@ -630,7 +630,7 @@ Let's add another model, this time: `Comment`. We want to create a relation - a
Instead of coding the model and controller by hand, we're going to create a **comment scaffold** which will generate a fully working CRUD API comments. We're also going to use the special `references` type:
```sh
$ cargo loco generate scaffold comment content:text article:references -k api
$ cargo loco generate scaffold comment content:text article:references --api
```
If you peek into the new migration, you'll discover a new database relation in the articles table:
Expand Down
4 changes: 2 additions & 2 deletions docs-site/content/docs/getting-started/tour/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ You can choose between generating an `api`, `html` or `htmx` scaffold using the
</div>

```sh
$ cargo loco generate scaffold post title:string content:text -k api
$ cargo loco generate scaffold post title:string content:text --api

:
:
Expand Down Expand Up @@ -168,7 +168,7 @@ For those counting -- the commands for creating a blog backend were:
1. `cargo install loco-cli`
2. `cargo install sea-orm-cli`
3. `loco new`
4. `cargo loco generate scaffold post title:string content:text -k api`
4. `cargo loco generate scaffold post title:string content:text --api`

Done! enjoy your ride with `loco` 🚂

Expand Down
2 changes: 1 addition & 1 deletion docs-site/content/docs/the-app/your-project.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ Options:
You can begin by generating a scaffold for the Post resource, which will represent a single blog posting. To accomplish this, open your terminal and enter the following command:
<!-- <snip id="scaffold-post-command" inject_from="yaml" template="sh"> -->
```sh
cargo loco generate scaffold posts name:string title:string content:text
cargo loco generate scaffold posts name:string title:string content:text --api
```
<!-- </snip> -->

Expand Down
2 changes: 1 addition & 1 deletion snipdoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ snippets:
path: ./snipdoc.yml
scaffold-post-command:
content: cargo loco generate scaffold posts
name:string title:string content:text
name:string title:string content:text --api
path: ./snipdoc.yml
generate-task-help-command:
content: cd ./examples/demo && cargo loco generate task --help
Expand Down

0 comments on commit aac4b9e

Please sign in to comment.