HEX
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.33
System: Linux li317-225.members.linode.com 3.10.0-1062.12.1.el7.x86_64 #1 SMP Tue Feb 4 23:02:59 UTC 2020 x86_64
User: apache (48)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: //var/www/farm.kosmicfarms/app/config/router.php
<?php
use Phalcon\Mvc\Router\Group as RouterGroup;

$router = $di->getRouter();
$router->removeExtraSlashes(true); 

$router->clear();

$router->setDefaults([
    'controller' => 'dashboard', // The name of your new controller (e.g., MyNewDefaultController)
    'action'     => 'index',         // The default action
]);

$router->add('/', [
    'controller' => 'dashboard',
    'action'     => 'index',
]);

$router->add('/login',['controller' => 'session','action' => 'index',]);
$router->add('/session/login',['controller' => 'session','action' => 'login',]);
$router->add('/logout', ['controller' => 'session','action' => 'logout',]);

/* Start of sensor group */
// Create a group with commom controller SensorController')
$router->add('/sensors',[ 'controller' => 'sensor', 'action' => 'index',]);
$sensorsGroup = new RouterGroup(['controller' => 'sensor']);
// Set a common URI prefix for all routes in this group
$sensorsGroup->setPrefix('/sensors');
$sensorsGroup->add('/create', ['action' => 'create',]);
$sensorsGroup->add('/edit/{id}', ['action' => 'index',]);
$sensorsGroup->add('/{id}', ['action' => 'index',]);
$sensorsGroup->add('/{catch-all:.*}', ['action'     => 'index',]);
// Add the group to the main router
$router->mount($sensorsGroup);
/* End of Sensor Group */


$router->add('/water',[ 'controller' => 'water', 'action' => 'index',]);
$router->add('/water/addtank', [ 'controller' => 'water', 'action' => 'addtank',]);
$router->add('/water/{id:[1-9]+}', [ 'controller' => 'water', 'action' => 'gettank',]);
$router->add('/water/{id:[1-9]+}/update', [ 'controller' => 'water', 'action' => 'update',]);
$router->add('/water/{id:[1-9]+}/delete', [ 'controller' => 'water', 'action' => 'delete',]);




$router->handle($_SERVER['REQUEST_URI']);