post("/send", function(Request $req, Response $response) { $mentioner = new Webmention(); $source = $req->query["source"]; $mentioner->sendForPage($source); }); $router->post("/endpoint", function(Request $req, Response $response) { $source = $req->post['source']; $target = $req->post['target']; $endpoint = new Endpoint(); try { $endpoint->receiveWebmention($source, $target); } catch (InvalidUrlException $e) { $response->status_code = StatusCode::BadRequest; return "Source and target must be valid URLs"; } catch (InvalidTargetException $e) { $response->status_code = StatusCode::BadRequest; return "Target must be on the domain lewisdale.dev"; } $response->status_code = StatusCode::Created; }); $router->get('/', fn($req, $res) => "