chyabrung-cli 0.2.4

The `chy` command line tool for Chyabrung: scaffolding, dev server with hot reload, builds, generators, migrations and one-command deploys
//! # Routes: every URL of the app
//!
//! Start here. Routes are split by who calls them:
//!
//! | File     | What goes there                                         | URLs       |
//! |----------|---------------------------------------------------------|------------|
//! | `web.rs` | pages people open in a browser, the WebSocket           | `/...`     |
//! | `api.rs` | the JSON API for apps and other services                | `/api/...` |
//!
//! One line per route:
//!
//! ```ignore
//! route.get("/posts/{id}", PostController::show);       // `{id}` is read with `Path(id)`
//! route.resource("/posts", PostController);             // index, store, show, update, destroy
//! route.prefix("/admin").middleware(require_role("admin")).group(|route| {
//!     route.get("/stats", StatsController::index);      // GET /admin/stats
//! });
//! ```
//!
//! Run `chy routes` to list every route, or open http://127.0.0.1:2007/docs
//! for the API docs.

use chyabrung::prelude::*;

mod api;
mod web;

/// Every route of the app: the API under `/api`, then the web pages.
pub fn routes(route: &mut Route) {
    route.prefix("/api").group(api::routes);
    web::routes(route);
}