MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / app_router

Function app_router

packages/server/src/main.rs:6071–6080  ·  view source on GitHub ↗
(state: AppState, client_root: PathBuf, access_token: String)

Source from the content-addressed store, hash-verified

6069}
6070
6071fn app_router(state: AppState, client_root: PathBuf, access_token: String) -> Router {
6072 router(state).fallback(
6073 move |axum::extract::ConnectInfo(address): axum::extract::ConnectInfo<SocketAddr>,
6074 method,
6075 uri| {
6076 let access_token = address.ip().is_loopback().then(|| access_token.clone());
6077 static_files::serve_static(client_root.clone(), method, uri, access_token)
6078 },
6079 )
6080}
6081
6082#[cfg(unix)]
6083struct TerminalInputMode {

Callers 1

serveFunction · 0.85

Calls 3

routerFunction · 0.85
serve_staticFunction · 0.85
cloneMethod · 0.65

Tested by

no test coverage detected