add mobile api
This commit is contained in:
2
mobileapi/config/.gitignore
vendored
Normal file
2
mobileapi/config/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
main-local.php
|
||||
params-local.php
|
||||
1
mobileapi/config/bootstrap.php
Normal file
1
mobileapi/config/bootstrap.php
Normal file
@@ -0,0 +1 @@
|
||||
<?php
|
||||
53
mobileapi/config/main.php
Normal file
53
mobileapi/config/main.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
use mobileapi\components\JwtValidationData;
|
||||
use sizeg\jwt\Jwt;
|
||||
|
||||
$params = array_merge(
|
||||
require(__DIR__ . '/../../common/config/params.php'),
|
||||
require(__DIR__ . '/../../common/config/params-local.php'),
|
||||
require(__DIR__ . '/params.php'),
|
||||
require(__DIR__ . '/params-local.php')
|
||||
);
|
||||
|
||||
return [
|
||||
'id' => 'app-mobileapi',
|
||||
'name' =>'Fitness recepció',
|
||||
'basePath' => dirname(__DIR__),
|
||||
'bootstrap' => ['log'],
|
||||
'controllerNamespace' => 'mobileapi\controllers',
|
||||
'components' => [
|
||||
'request' => [
|
||||
'enableCsrfValidation'=>false,
|
||||
'csrfParam' => '_csrf-mobileapi',
|
||||
'parsers' => [
|
||||
'application/json' => 'yii\web\JsonParser',
|
||||
]
|
||||
],
|
||||
'user' => [
|
||||
'identityClass' => 'common\models\Customer',
|
||||
'enableSession' => false,
|
||||
'enableAutoLogin' => false,
|
||||
'loginUrl' => null,
|
||||
],
|
||||
'log' => [
|
||||
'traceLevel' => YII_DEBUG ? 3 : 0,
|
||||
'targets' => [
|
||||
[
|
||||
'class' => 'yii\log\FileTarget',
|
||||
'levels' => ['error', 'warning'],
|
||||
],
|
||||
],
|
||||
],
|
||||
'errorHandler' => [
|
||||
'errorAction' => 'site/error',
|
||||
],
|
||||
'jwt' => [
|
||||
'class' => Jwt::class,
|
||||
'key' => 'secret',
|
||||
// You have to configure ValidationData informing all claims you want to validate the token.
|
||||
'jwtValidationData' => JwtValidationData::class,
|
||||
],
|
||||
],
|
||||
'params' => $params,
|
||||
];
|
||||
4
mobileapi/config/params.php
Normal file
4
mobileapi/config/params.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
return [
|
||||
'adminEmail' => 'admin@example.com',
|
||||
];
|
||||
Reference in New Issue
Block a user