Some content
+Here's some body content. It contains a url.
+I'm liking this post.
+diff --git a/.gitignore b/.gitignore index 57872d0..2085207 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ /vendor/ +/.phpunit.result.cache +.idea diff --git a/index.php b/index.php index 0b8dbf4..d32efb1 100644 --- a/index.php +++ b/index.php @@ -11,13 +11,12 @@ use Lewisdale\Webmentions\Router\Response; use Lewisdale\Webmentions\Router\StatusCode; use Lewisdale\Webmentions\Webmention; -$mentioner = new Webmention(); - $router = new Router(); -$router->post("/send", function(Request $req, Response $response) use ($webmention) { - $source = $req->query["source"]; - $webmention->sendForPage($source); +$router->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) { @@ -39,6 +38,5 @@ $router->post("/endpoint", function(Request $req, Response $response) { $response->status_code = StatusCode::Created; }); -$router->dispatch(); - -?> \ No newline at end of file +$router->get('/', fn($req, $res) => "
Here's some body content. It contains a url.
-I'm liking this post.
+Here's some body content. It contains a url.
+I'm liking this post.
+