Bullsh.Art - Served by ARSE

A Rust Site Engine: v0.11.6

The core binary running the site:

A Rust Site Engine
Copyright 2020-2021 Anthony Martinez
Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or> or the MIT license <LICENSE-MIT or>, at your option. This file may not be
copied, modified, or distributed except according to those terms.

//! Main entry point for A Rust Site Engine.
//! # Options
//! - `run [config]`: Starts a server defined by the `[config]` TOML.
//! - `new`: Creates a new `[config]` TOML from user input, and creates
//!          the site's directory structure.

use std::net::SocketAddr;
use std::sync::Arc;

use anyhow::{anyhow, Context, Error, Result};
use log::{info, error};
use hyper::Server;
use routerify::RouterService;

mod config;
mod common;
mod render;
mod routes;

async fn main() -> Result<()> {
    let config = config::load()?;
    let app = Arc::new(config);
    info!("Configuration loaded");

    let engine = Arc::new(render::Engine::new(app));
    info!("Rendering Engine loaded");
    let router = routes::router(engine.clone());
    info!("Route handlers loaded");

    let service = RouterService::new(router).unwrap();
    info!("Service loaded");

    let addr = format!("{}:{}",,;
    let addr: SocketAddr = addr.parse().unwrap();
    info!("Creating server on: {}", &addr);

    let server = Server::bind(&addr).serve(service);
    info!("Running server on: {}", &addr);

    if let Err(err) = server.await {
	error!("Server error: {}", err)