Crates.io | pagetop |
lib.rs | pagetop |
version | 0.0.57 |
source | src |
created_at | 2022-10-13 19:21:57.263696 |
updated_at | 2024-12-01 11:42:13.265128 |
description | An opinionated web framework to build modular Server-Side Rendering web solutions. |
homepage | https://pagetop.cillero.es |
repository | https://github.com/manuelcillero/pagetop |
max_upload_size | |
id | 687407 |
size | 434,255 |
The PageTop core API provides a comprehensive toolkit for extending its functionalities to specific requirements and application scenarios through actions, components, packages, and themes:
Actions serve as a mechanism to customize PageTop's internal behavior by intercepting its execution flow.
Components encapsulate HTML, CSS, and JavaScript into functional, configurable, and well-defined units.
Packages extend or customize existing functionality by interacting with PageTop APIs or third-party package APIs.
Themes enable developers to alter the appearance of pages and components without affecting their functionality.
use pagetop::prelude::*;
struct HelloWorld;
impl PackageTrait for HelloWorld {
fn configure_service(&self, scfg: &mut service::web::ServiceConfig) {
scfg.route("/", service::web::get().to(hello_world));
}
}
async fn hello_world(request: HttpRequest) -> ResultPage<Markup, ErrorPage> {
Page::new(request)
.with_component(Html::with(html! { h1 { "Hello World!" } }))
.render()
}
#[pagetop::main]
async fn main() -> std::io::Result<()> {
Application::prepare(&HelloWorld).run()?.await
}
This program features a HelloWorld
package, providing a service that serves a greeting web page
accessible via http://localhost:8088
under default settings.
pagetop-macros: A collection of procedural macros that enhance the development experience within PageTop.
pagetop-build: Simplifies the process of embedding resources directly into binary files for PageTop applications.
PageTop framework is currently in active development. The API is unstable and subject to frequent changes. Production use is not recommended until version 0.1.0.
PageTop is free, open source and permissively licensed! Except where noted (below and/or in individual files), all code in this project is dual-licensed under either:
MIT License (LICENSE-MIT or https://opensource.org/licenses/MIT)
Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
at your option. This means you can select the license you prefer! This dual-licensing approach is the de-facto standard in the Rust ecosystem.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.