通过命令: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',
        ],
    ],
];

点赞(1) 打赏

评论列表 共有 0 条评论

暂无评论

微信小程序

微信扫一扫体验

立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部