class

LF::Router

Inherits HTTP::Handler < Reference < Object

Constructors

Instance methods

add(path : String, methods : Set(String) = Set {"GET"}, &handler : HTTP::Server::Context, Hash(String, String) -> Nil)

Add a route with handler

Source
add(path : String, handler : Trie::Handler, methods : Set(String) = Set {"GET"})

Add a route with handler (non-block version)

Source
delete(path : String, &handler : HTTP::Server::Context, Hash(String, String) -> Nil)

Convenience method for DELETE routes

Source
get(path : String, &handler : HTTP::Server::Context, Hash(String, String) -> Nil)

Convenience method for GET routes

Source
patch(path : String, &handler : HTTP::Server::Context, Hash(String, String) -> Nil)

Convenience method for PATCH routes

Source
post(path : String, &handler : HTTP::Server::Context, Hash(String, String) -> Nil)

Convenience method for POST routes

Source
put(path : String, &handler : HTTP::Server::Context, Hash(String, String) -> Nil)

Convenience method for PUT routes

Source