MCPcopy Create free account
hub / github.com/fadeevab/design-patterns-rust / handle_request

Method handle_request

structural/proxy/server/application.rs:6–16  ·  view source on GitHub ↗
(&mut self, url: &str, method: &str)

Source from the content-addressed store, hash-verified

4
5impl Server for Application {
6 fn handle_request(&mut self, url: &str, method: &str) -> (u16, String) {
7 if url == "/app/status" && method == "GET" {
8 return (200, "Ok".into());
9 }
10
11 if url == "/create/user" && method == "POST" {
12 return (201, "User Created".into());
13 }
14
15 (404, "Not Ok".into())
16 }
17}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected