通过命令:cp backend/ api -r 生成api模块。
api模块初始化生成配置,yii更目录初始化输入:./init(linux环境生效或者git bash下可用)回车初始化yii:
return [
'Development' => [
'path' => 'dev',
'setWritable' => [
'backend/runtime',
'backend/web/assets',
'api/runtime',
'api/web/assets',
'console/runtime',
'frontend/runtime',
'frontend/web/assets',
],
'setExecutable' => [
'yii',
'yii_test',
],
'setCookieValidationKey' => [
'backend/config/main-local.php',
'api/config/main-local.php',
'common/config/codeception-local.php',
'frontend/config/main-local.php',
],
],
'Production' => [
'path' => 'prod',
'setWritable' => [
'backend/runtime',
'backend/web/assets',
'api/runtime',
'api/web/assets',
'console/runtime',
'frontend/runtime',
'frontend/web/assets',
],
'setExecutable' => [
'yii',
],
'setCookieValidationKey' => [
'backend/config/main-local.php',
'api/config/main-local.php',
'frontend/config/main-local.php',
],
],
];
发表评论 取消回复