web-base

web_base is an open-source Rust crate designed to simplify web application development by providing a collection of utilities and configurations for building web applications.

Features

  1. Site Configuration: web_base provides a Site struct that allows you to configure various aspects of your web application, including:
  2. Utilities: web_base offers a set of utility functions to simplify common web development tasks:
  3. Based on Actix Web: The map! macro simplifies the process of creating an Actix Web HTTP server with specific configurations and middleware. It automatically sets up various server configurations based on the Site configuration, making it easier to create your Actix Web server.

Examples

web_base provides several examples and use cases for its features. Check the documentation and code examples to see how to leverage this library for your web application needs.

Getting Started

To use this crate in your project, you have to add tokio and actix-web to your Cargo.toml.

Run some examples from examples directory or use this as a base: ```rust use actix_web::{get, HttpRequest, Responder}; use maud::html;

[get("/")]

pub(crate) async fn index(r: HttpRequest) -> impl Responder { let content = html!( p { "Hello World" }; ) .intostring(); webbase::func::build_site(&r, "Index", &content) }

[actix_web::main]

async fn main() -> std::io::Result<()> { webbase::map!( webbase::Site::new() .enablebootstrap(false) .enablepicocss(false), |app: actixweb::App<_>| { app.service(index) } ) .bind(("0.0.0.0".tostring(), 8080))? .run() .await } ```