ryuk-cli 0.1.1

The `ryuk` command: scaffold a Ryuk app (axum, SeaORM, Inertia/Svelte), generate controllers, models, jobs and mails, run migrations and the dev server.
1
2
3
4
5
6
7
8
9
10
// `ryuk make:api` registered this route in src/api.rs (above its `// ryuk:api-routes` marker).
use ryuk::api::{ApiAuth, ApiError};

/// Short path: the api group is mounted under `/api`, so this is served as `/api/{{snake}}`.
#[utoipa::path(get, path = "/{{snake}}", security(("api_key" = []), ("oauth2" = ["{{snake}}:read"])),
    responses((status = 200, description = "{{Name}} index"), (status = 401, description = "Missing or invalid credential"), (status = 403, description = "Missing scope {{snake}}:read")))]
pub async fn index(ApiAuth(p): ApiAuth) -> Result<axum::Json<serde_json::Value>, ApiError> {
    p.require("{{snake}}:read")?;
    Ok(axum::Json(serde_json::json!({ "data": [] })))
}