| Crates.io | suika_server |
| lib.rs | suika_server |
| version | 0.1.8 |
| created_at | 2025-01-01 21:34:38.263731+00 |
| updated_at | 2025-06-15 22:33:02.525338+00 |
| description | A server library for the suika web stack |
| homepage | |
| repository | https://github.com/JonWatkins/suika/tree/master/crates/suika_server |
| max_upload_size | |
| id | 1501097 |
| size | 121,673 |
Important: This is a personal toy project, developed as an experiment and learning exercise.
As a toy project, its future development is uncertain. It may or may not receive future updates, maintenance, or bug fixes. Please do not use it in production environments.
Suika Server is a core component for handling HTTP requests and responses within the Suika web stack (also a toy project). It provides foundational elements for building a web server, primarily for understanding server-side concepts and for experimental purposes.
The API is subject to change. This project is not thoroughly tested or hardened for real-world applications, and documentation may be basic.
use suika::server::{Server, Router};
use std::sync::Arc;
pub fn main() {
let mut server = Server::new("127.0.0.1:8080");
let mut router = Router::new("/");
router.get(r"/?$", |_req, res| {
Box::pin(async move {
res.set_status(201).await;
res.body("Hello World!".to_string()).await;
Ok(())
})
});
server.use_middleware(Arc::new(router));
server.run();
}