Skip to content

Commit

Permalink
add api prefix for api generator
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacdonaldson committed Oct 8, 2024
1 parent 2a13c65 commit 87dcb3e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/gen/templates/controller/api/controller.t
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub async fn {{action}}(State(_ctx): State<AppContext>) -> Result<Response> {

pub fn routes() -> Routes {
Routes::new()
.prefix("{{file_name | plural}}/")
.prefix("api/{{file_name | plural}}/")
.add("/", get(index))
{%- for action in actions %}
.add("{{action}}", get({{action}}))
Expand Down
2 changes: 1 addition & 1 deletion src/gen/templates/scaffold/api/controller.t
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ pub async fn get_one(Path(id): Path<i32>, State(ctx): State<AppContext>) -> Resu

pub fn routes() -> Routes {
Routes::new()
.prefix("{{file_name | plural}}/")
.prefix("api/{{file_name | plural}}/")
.add("/", get(list))
.add("/", post(add))
.add(":id", get(get_one))
Expand Down

0 comments on commit 87dcb3e

Please sign in to comment.