Refactor APIs to use routing

This commit is contained in:
Dale Davies
2022-07-18 14:29:49 +01:00
parent 4b5d51ee52
commit 42568ff66c
16 changed files with 227 additions and 209 deletions

View File

@@ -26,6 +26,15 @@ class Main {
$this->router->addRoute('/tag/<tag>', [
'class' => 'Jump\Pages\TagPage'
]);
$this->router->addRoute('/api/icon?siteurl=<siteurl>', [
'class' => 'Jump\API\Icon'
]);
$this->router->addRoute('/api/unsplash[/<token>]', [
'class' => 'Jump\API\Unsplash'
]);
$this->router->addRoute('/api/weather[/<token>[/<lat>[/<lon>]]]', [
'class' => 'Jump\API\Weather'
]);
}
function init() {