💾 Archived View for alchemi.dev › en › projects › kochab › files › examples › rewrite.rs captured on 2023-09-28 at 15:56:24.

View Raw

More Information

⬅️ Previous capture (2022-07-16)

-=-=-=-=-=-=-


use std::path::PathBuf;

use anyhow::*;
use log::LevelFilter;
use kochab::Server;

#[tokio::main]
async fn main() -> Result<()> {
    env_logger::builder()
        .filter_module("kochab", LevelFilter::Debug)
        .init();

    Server::new()
        .add_route("/", PathBuf::from("public/test.gmi")) // Serve a single file
        .set_autorewrite(true)
        .serve_unix("kochab.sock")
        .await
}