From c5d2deb5bfa9e9c56e20263c70bb48902d8cff97 Mon Sep 17 00:00:00 2001 From: Manuel Cillero Date: Mon, 2 Dec 2024 12:11:28 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Doc=20tweak?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1dba1342..117da733 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,20 @@ requirements and application scenarios through actions, components, packages, an # ⚡️ Quick start +The simplest PageTop application looks like this: + +```rust +use pagetop::prelude::*; + +#[pagetop::main] +async fn main() -> std::io::Result<()> { + Application::new().run()?.await +} +``` + +This provides a default homepage at `http://localhost:8088` using the default configuration. To +customize the service, you can define a PageTop package like this: + ```rust use pagetop::prelude::*; @@ -53,8 +67,8 @@ async fn main() -> std::io::Result<()> { } ``` -This program features a `HelloWorld` package, providing a service that serves a greeting web page -accessible via `http://localhost:8088` under default settings. +This program defines a custom `HelloWorld` package to serve a page at the root path (`/`) displaying +a "Hello World!" message inside an HTML `

` element. # 📂 Helpers