Files
This commit is contained in:
@ -1,12 +1,8 @@
|
||||
<?php
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Incoviba\API\Common\Service\Auth as Service;
|
||||
use Incoviba\API\Common\Controller\Auth;
|
||||
|
||||
$app->get('/auth/generate', function(Request $request, Response $response, Service $service): Response {
|
||||
$key = $service->generate();
|
||||
$response->getBody()->write(json_encode(['key' => $key]));
|
||||
return $response
|
||||
->withStatus(200)
|
||||
->withHeader('content-type', 'application/json');
|
||||
});
|
||||
$app->post('/auth/login[/]', [Auth::class, 'login']);
|
||||
$app->get('/auth/generate[/]', [Auth::class, 'generate']);
|
||||
$app->post('/auth/validate[/]', [Auth::class, 'validate']);
|
||||
$app->post('/auth/user[/]', [Auth::class, 'user']);
|
||||
$app->post('/auth/logout[/]', [Auth::class, 'logout']);
|
||||
|
5
resources/routes/configs.php
Normal file
5
resources/routes/configs.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
use Incoviba\API\Common\Controller\Configs;
|
||||
|
||||
$app->get('/config/{config_name}', [Configs::class, 'get']);
|
||||
$app->post('/config', [Configs::class, 'set']);
|
@ -1,8 +1,18 @@
|
||||
<?php
|
||||
use Incoviba\API\Common\Controller\Proyectos;
|
||||
use Incoviba\API\Common\Controller\Proyectos\Cuotas;
|
||||
use Incoviba\API\Common\Controller\Proyectos\Cierres;
|
||||
|
||||
$app->group('/proyectos', function ($app) {
|
||||
$app->post('/add[/]', [Proyectos::class, 'add']);
|
||||
$app->group('/cuotas', function($app) {
|
||||
$app->get('/hoy[/]', [Cuotas::class, 'hoy']);
|
||||
$app->get('/mes[/]', [Cuotas::class, 'mes']);
|
||||
$app->get('/pendientes[/]', [Cuotas::class, 'pendientes']);
|
||||
});
|
||||
$app->group('/cierres', function($app) {
|
||||
$app->get('[/]', Cierres::class);
|
||||
});
|
||||
$app->get('[/]', Proyectos::class);
|
||||
});
|
||||
$app->group('/proyecto/{proyecto_id}', function ($app) {
|
||||
|
Reference in New Issue
Block a user