diff --git a/flextype/bootstrap.php b/flextype/bootstrap.php index 8f652f45..729cea7c 100755 --- a/flextype/bootstrap.php +++ b/flextype/bootstrap.php @@ -126,9 +126,10 @@ include_once 'dependencies.php'; include_once 'middlewares.php'; /** - * Include Routes (web) + * Include Routes (web, api) */ include_once 'routes/web.php'; +include_once 'routes/api.php'; /** diff --git a/flextype/routes/api.php b/flextype/routes/api.php new file mode 100644 index 00000000..db19cc96 --- /dev/null +++ b/flextype/routes/api.php @@ -0,0 +1,30 @@ +get('/api/entries', function (Request $request, Response $response, array $args) use ($flextype) { + + // Get Query Params + $query = $request->getQueryParams(); + + // + if (!isset($query['auth_token'])) { + return $response->withJson(["detail" => "Incorrect authentication credentials."]); + } + + // Response data + $data = []; + + // Return response + return $response->withJson($data); +});