match('GET', '/packages')) { $tags = explode(';', (string)$request->getQueryParam('tags', FILTER_SANITIZE_STRING)); $packages = empty($tags) ? Patchouli::getPackages() : Patchouli::getPackagesWithTags($tags); echo FWIF::encode($packages); return; } if($request->match('GET', '/')) { header('Content-Type: text/html; charset=utf-8'); echo '
'; readfile(PAT_ROOT . '/patchouli.txt'); echo ''; return; } http_response_code(404); echo '{"code":404,"message":"Path not found."}';