-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Api tool section usable via basic auth
- Loading branch information
1 parent
17dda8c
commit 1c52b7e
Showing
3 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
use Psr\Http\Message\ResponseInterface as Response; | ||
use Psr\Http\Message\ServerRequestInterface as Request; | ||
use Slim\Routing\RouteCollectorProxy; | ||
|
||
use Ramsey\Uuid\Uuid; | ||
|
||
use Crunz\Configuration\Configuration; | ||
use Crunz\Schedule; | ||
use Crunz\Filesystem; | ||
use Crunz\Task\Collection; | ||
use Crunz\Task\WrongTaskInstanceException; | ||
|
||
foreach (glob(__DIR__ . '/../classes/*.php') as $filename){ | ||
require_once $filename; | ||
} | ||
|
||
use Symfony\Component\Yaml\Yaml; | ||
|
||
$app->group('/tools', function (RouteCollectorProxy $group) { | ||
|
||
$group->get('/test-conn', function (Request $request, Response $response, array $args) { | ||
|
||
$data = []; | ||
|
||
|
||
$response->getBody()->write(json_encode($data, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT)); | ||
return $response->withStatus(200) | ||
->withHeader("Content-Type", "application/json"); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters