mirror of
https://git.steelants.cz/SH/PHP_SMART_HOME_V3.git
synced 2026-10-11 17:54:34 +00:00
CleanUp After Docker Try
This commit is contained in:
1 parent
2f638d8091
commit
090b9f7a7b
123 files changed
+5265
No files matched your search
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
$router = new Router();
|
||||
|
||||
$router->setDefault(function(){
|
||||
echo $_GET['url'].': 404';
|
||||
});
|
||||
|
||||
//Pages
|
||||
$router->any('/', 'Log');
|
||||
$router->any('/login', 'Login');
|
||||
$router->any('/logout', 'Logout');
|
||||
$router->any('/automation', 'Automation');
|
||||
$router->any('/setting', 'Setting');
|
||||
$router->any('/ajax', 'Ajax');
|
||||
|
||||
$router->post('/api/login', 'AuthApi@login');
|
||||
$router->post('/api/logout', 'AuthApi@logout');
|
||||
|
||||
$router->get('/api/devices', 'DevicesApi@default');
|
||||
$router->get('/api/rooms', 'RoomsApi@default');
|
||||
|
||||
$router->get('/api/HA/auth', 'GoogleHomeApi@autorize');
|
||||
$router->any('/api/HA', 'GoogleHomeApi@response');
|
||||
|
||||
// examples
|
||||
$router->any('/api/example', 'ExampleApi@example');
|
||||
$router->any('/example', 'ExampleController@index');
|
||||
$router->any('/example/subpage', 'ExampleController@subpage');
|
||||
|
||||
$router->run($_SERVER['REQUEST_METHOD'], '/'.(isset($_GET['url']) ? $_GET['url'] : ''));
|
||||
Reference in new issue
Block a user