2022-09-22 22:17:41 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Psr\Http\Message\ResponseInterface as Response;
|
|
|
|
use Psr\Http\Message\ServerRequestInterface as Request;
|
|
|
|
use Slim\Views\Twig;
|
|
|
|
|
2022-09-24 16:26:57 -04:00
|
|
|
use BitGoblin\MCST\Minecraft\Server;
|
|
|
|
|
2022-09-22 22:17:41 -04:00
|
|
|
// index GET route - this page should welcome the user and direct them to the available actions
|
2022-10-07 17:47:10 -04:00
|
|
|
$app->get('/', '\\BitGoblin\\MCST\\Controllers\\HomeController:getIndex')->setName('index');
|
2022-09-22 23:28:06 -04:00
|
|
|
|
|
|
|
// create GET route - this page allows a user to create a new server instance
|
2022-10-07 17:47:10 -04:00
|
|
|
$app->get('/create', '\\BitGoblin\\MCST\\Controllers\\ServerController:getCreate')->setName('create');
|
2022-09-22 23:28:06 -04:00
|
|
|
// create POST route - processes the new server creation
|
2022-10-07 17:47:10 -04:00
|
|
|
$app->post('/create', '\\BitGoblin\\MCST\\Controllers\\ServerController:postCreate');
|
2022-09-24 20:45:37 -04:00
|
|
|
|
2022-09-24 21:29:12 -04:00
|
|
|
// server status route
|
2022-10-07 17:47:10 -04:00
|
|
|
$app->get('/server/{serverName}/status', '\\BitGoblin\\MCST\\Controllers\\ServerController:getStatus')->setName('server.status');
|
2022-09-24 21:29:12 -04:00
|
|
|
|
2022-09-24 20:45:37 -04:00
|
|
|
// server start route
|
2022-10-07 17:47:10 -04:00
|
|
|
$app->get('/server/{serverName}/start', '\\BitGoblin\\MCST\\Controllers\\ServerController:getStart')->setName('server.start');
|
2022-09-24 20:45:37 -04:00
|
|
|
// server stop route
|
2022-10-07 17:47:10 -04:00
|
|
|
$app->get('/server/{serverName}/stop', '\\BitGoblin\\MCST\\Controllers\\ServerController:getStop')->setName('server.stop');
|