Skip to main content

spawn_http_server

Function spawn_http_server 

Source
pub async fn spawn_http_server(
    routes: HashMap<String, (&'static str, String)>,
    fallback: Option<(&'static str, String)>,
) -> FakeJwksServer
Available on crate feature testing only.
Expand description

Serve routes, falling back to fallback (or a 404) for any other path.

ยงPanics

If no loopback port can be bound. Must be called inside a tokio runtime (it spawns the accept loop).