mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-23 09:02:41 +00:00
536fa5c4fd
- Improves #47 - Still needs wrapping to actually output to clients
25 lines
No EOL
644 B
PHP
25 lines
No EOL
644 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
namespace JKingWeb\NewsSync\REST\NextCloudNews;
|
|
use JKingWeb\NewsSync\REST\Response;
|
|
|
|
class Versions implements \JKingWeb\NewsSync\REST\Handler {
|
|
function __construct(\JKingWeb\NewsSync\RuntimeData $data) {
|
|
}
|
|
|
|
function dispatch(\JKingWeb\NewsSync\REST\Request $req): \JKingWeb\NewsSync\REST\Response {
|
|
$path = $req->url;
|
|
$query = "";
|
|
if(strpos($path, "?") !== false) {
|
|
list($path, $query) = explode("?", $path);
|
|
}
|
|
if($req->method != "GET") {
|
|
return new Response(405);
|
|
}
|
|
if(preg_match("<^/?$>",$path)) {
|
|
return new Response(200, ['v1-2']);
|
|
} else {
|
|
return new Response(404);
|
|
}
|
|
}
|
|
} |