From 87dcb3e9d875e3cbcc26b3b7233bb340edf62da5 Mon Sep 17 00:00:00 2001 From: Isaac Date: Tue, 8 Oct 2024 11:28:14 -0700 Subject: [PATCH] add api prefix for api generator --- src/gen/templates/controller/api/controller.t | 2 +- src/gen/templates/scaffold/api/controller.t | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gen/templates/controller/api/controller.t b/src/gen/templates/controller/api/controller.t index 1982f1426..7136bb870 100644 --- a/src/gen/templates/controller/api/controller.t +++ b/src/gen/templates/controller/api/controller.t @@ -32,7 +32,7 @@ pub async fn {{action}}(State(_ctx): State) -> Result { 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}})) diff --git a/src/gen/templates/scaffold/api/controller.t b/src/gen/templates/scaffold/api/controller.t index 382eb6a29..d81c0bf44 100644 --- a/src/gen/templates/scaffold/api/controller.t +++ b/src/gen/templates/scaffold/api/controller.t @@ -81,7 +81,7 @@ pub async fn get_one(Path(id): Path, State(ctx): State) -> 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))