Skip to content

Commit

Permalink
Adiciona limite de solicitações de resposta
Browse files Browse the repository at this point in the history
  • Loading branch information
a21ns1g4ts committed May 31, 2020
1 parent 25efeac commit 3c70189
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 14 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Changelog

## [1.0.0] - 25/05/2020
## [1.0.0] - 31/05/2020

### Recursos adicionados

* API
* Repositórios DB e FILE
* Integração Contínua
* Política de consumo da api
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,18 @@ Veja
http://localhost:8080

## API

**Importante:**

Atualmente temos uma api demonstração no seguinte endereço: https://cid10-api.herokuapp.com.
No entanto, a partir de 2021 ela será desativada e funcionará na seguinte url: https://cid.mokasof.org.

Você só pode fazer 60 requisições por minuto. Com um tempo de retenção de 3 minutos caso exceda o limite.
Se você se sentir mal por isso sinta-se livre para fazer um clone do projeto e executar a api na sua máquina,
basta configurar essa política como falsa no arquivo .env `APP_THROTTLE=false`

Servidores não dão em árvore e não tente enganar as nossas estatisticas.

##### CID-10

|Nome|Descrição|Rota|Demo|
Expand Down
20 changes: 9 additions & 11 deletions bootstrap/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,10 @@
|
*/

/*register cors policy*/
$app->register(GrahamCampbell\Throttle\ThrottleServiceProvider::class);

$app->register(Fruitcake\Cors\CorsServiceProvider::class);
$app->configure('cors');
$app->middleware([
\Fruitcake\Cors\HandleCors::class,
\App\Http\Middleware\VisitorAnalyticsMiddleware::class
]);

$app->singleton(
Illuminate\Contracts\Console\Kernel::class,
Expand Down Expand Up @@ -101,13 +97,14 @@
|
*/

// $app->middleware([
// App\Http\Middleware\ExampleMiddleware::class
// ]);
$app->middleware([
\Fruitcake\Cors\HandleCors::class,
\App\Http\Middleware\VisitorAnalyticsMiddleware::class
]);

// $app->routeMiddleware([
// 'auth' => App\Http\Middleware\Authenticate::class,
// ]);
$app->routeMiddleware([
'throttle' => GrahamCampbell\Throttle\Http\Middleware\ThrottleMiddleware::class,
]);

/*
|--------------------------------------------------------------------------
Expand Down Expand Up @@ -137,6 +134,7 @@

$app->router->group([
'namespace' => 'App\Http\Controllers',
'middleware' => env('APP_THROTTLE') ? 'throttle:60,3' : null
], function ($router) {
require __DIR__.'/../routes/web.php';
require __DIR__.'/../routes/api.php';
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Atiladanvi/cid-api-php",
"name": "atiladanvi/cid-api-php",
"description": "Api com todas as doenças catalogadas pela OMS.",
"authors": [
{
Expand All @@ -14,6 +14,7 @@
"php": "^7.2.5",
"ext-json": "*",
"fruitcake/laravel-cors": "^2.0",
"graham-campbell/throttle": "^8.0",
"laravel/lumen-framework": "^7.0"
},
"require-dev": {
Expand Down
79 changes: 78 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3c70189

Please sign in to comment.