glacier-web-cli 0.2.0

Command-line tool for creating and running Glacier applications.
//! The app as a library, so `main.rs` and the tests in `tests/` share it.

pub mod controllers;
pub mod migrations;
pub mod models;
pub mod routes;
glacier::seeds!();

use glacier::db::Repo;
use glacier::middleware::{JsonErrors, Logger};
use glacier::prelude::*;

/// The configured app: middleware, routes and database.
pub fn app(config: Config, repo: Repo) -> glacier::Result<App> {
    Ok(App::new()
        .config(config)?
        .database(repo)
        .migrations(migrations::all())
        .seeds(seeds::run)
        .middleware(Logger)
        // Every error as JSON, unknown paths too.
        .middleware(JsonErrors)
        .routes(routes::draw))
}