From c9533688bab7b97c4213303786d7d17617dca168 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Thu, 20 Feb 2025 16:41:41 +0100 Subject: [PATCH] getting api working --- api/config/bootstrap.php | 1 + api/config/main.php | 6 +++--- api/config/params.php | 4 ++++ api/config/test.php | 4 ++++ api/controllers/SiteController.php | 2 +- environments/index.php | 2 ++ 6 files changed, 15 insertions(+), 4 deletions(-) diff --git a/api/config/bootstrap.php b/api/config/bootstrap.php index e69de29..b3d9bbc 100644 --- a/api/config/bootstrap.php +++ b/api/config/bootstrap.php @@ -0,0 +1 @@ + 'app-backend', + 'id' => 'calorie-api', 'basePath' => dirname(__DIR__), - 'controllerNamespace' => 'backend\controllers', + 'controllerNamespace' => 'api\controllers', 'bootstrap' => ['log'], 'modules' => [], 'components' => [ @@ -23,7 +23,7 @@ return [ ], 'session' => [ // this is the name of the session cookie used for login on the backend - 'name' => 'advanced-backend', + 'name' => 'calorie-api', ], 'log' => [ 'traceLevel' => YII_DEBUG ? 3 : 0, diff --git a/api/config/params.php b/api/config/params.php index e69de29..b625128 100644 --- a/api/config/params.php +++ b/api/config/params.php @@ -0,0 +1,4 @@ + [ 'path' => 'dev', 'setWritable' => [ + 'api/runtime', 'console/runtime', 'frontend/runtime', 'frontend/web/assets', @@ -41,6 +42,7 @@ return [ 'yii_test', ], 'setCookieValidationKey' => [ + 'api/config/main-local.php', 'common/config/codeception-local.php', 'frontend/config/main-local.php', ],