#[server]Expand description
Blessed preset: HTTP server with OpenAPI and serve.
Combines #[http] + #[serve(http)] into a single attribute.
§Example
ⓘ
use server_less::server;
#[derive(Clone)]
struct MyApi;
#[server]
impl MyApi {
pub fn list_items(&self) -> Vec<String> { vec![] }
pub fn create_item(&self, name: String) -> String { name }
}
// Equivalent to:
// #[http]
// #[serve(http)]
// impl MyApi { ... }§Options
prefix- URL prefix (e.g.,#[server(prefix = "/api")])openapi- Toggle OpenAPI generation (default: true)health- Custom health check path (default:/health)