From 7f4a8178e038d42deefa652ee9f39013166a1433 Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Sun, 3 Feb 2019 14:54:28 -0500 Subject: [PATCH] mediocre routing for new domains --- controller/Controller.class.php | 5 ----- controller/action/ContentActions.class.php | 8 ++++++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/controller/Controller.class.php b/controller/Controller.class.php index 14be167e..28875fc7 100644 --- a/controller/Controller.class.php +++ b/controller/Controller.class.php @@ -79,11 +79,6 @@ class Controller $router->get(['/', 'home'], 'ContentActions::executeHome'); - // - $router->get('/org', 'ContentActions::executeOrg'); - $router->get('/tv', 'ContentActions::executeTv'); - // - $router->get(['/get', 'get'], 'DownloadActions::executeGet'); $router->get(['/getrubin', 'getrubin'], 'DownloadActions::executeGet'); foreach (array_keys(OS::getAll()) as $os) { diff --git a/controller/action/ContentActions.class.php b/controller/action/ContentActions.class.php index 8d1ee61e..9797dbe8 100644 --- a/controller/action/ContentActions.class.php +++ b/controller/action/ContentActions.class.php @@ -29,6 +29,14 @@ class ContentActions extends Actions public static function executeHome(): array { Response::enableHttpCache(); + + $serverName = Request::getServerName(); + if ($serverName === 'lbry.org') { + return static::executeOrg(); + } else if ($serverName === 'lbry.tv') { + return static::executeTv(); + } + return ['page/home']; }