chyabrung-cli 0.2.3

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                                         |
//! |-----------------|---------------------------------------------------------|
//! | `web.rs`        | pages people open in a browser (`/`, `/about`, ...)     |
//! | `api.rs`        | the JSON API under `/api`, plus WebSockets and events   |
//!
//! Each line in those files connects an HTTP method and a path to a handler
//! in `src/controllers/`. Groups share a URL prefix and middleware.
//!
//! - `.get("/me", auth_controller::me)` connects one URL to one function.
//! - `.mount(PostController)` adds every route of a `#[controller]` at once.
//! - `:id` in a path is a parameter, read in the handler with `Path(id)`.
//! - Run `cargo run` or `chy dev` and open http://127.0.0.1:2007/docs for the API docs.
//! - `chy routes` lists every route of the app.

use chyabrung::prelude::*;

mod api;
mod web;

/// Add all routes to the app: the API, then the web pages.
pub fn register(app: App) -> App {
    let app = api::register(app);
    web::register(app)
}