1
0
Fork 0
forked from are0h/tapes
tapes/brain/controllers/APIController.php
Ro b72650ed2f Intial Project Commit
first commit to get all the project files in there
2025-03-05 16:14:37 -06:00

33 lines
747 B
PHP

<?php
namespace brain\controllers;
class APIController
{
protected $tapes;
public function __construct()
{
$this->tapes = new TapesAPI();
}
public function handleRoute($params)
{
if (isset($params[1])) {
//grap appropriate api class based on request params
switch ($params[1]) {
case "tapes":
//run the request
return $this->tapes->handleRequest($params);
break;
default:
break;
}
} else {
return json_encode([
"message" => "NO API Identifier provided",
"type" => "ERROR",
]);
}
}
}