OxL Справочник OxL
РусскийEnglish

method Router.new

An empty router (every request is a 404 until routes are added).

Example:

oxl✓ проверяется в CI
use std.http { Router, Request, Reply }

fn main() io {
  let r = Router.new().get("/", (req: Request) => Reply.text("home"))
  print("built")
}
Вывод
built
pub(api) static fn new() -> Router

С версии. 1.0.0-beta

Возвращает

Router

Эффекты

не объявлены (чистая, пока тело не говорит иное)

Определено в: std/http/http.oxl:3329

См. также