prawee/yii2-gae-api
使用Yii2创建RESTful API以部署在Google App Engine上
1.0
2019-03-15 10:39 UTC
Requires
- vlucas/phpdotenv: ^2.4
- yiisoft/yii2: ^2.0
Requires (Dev)
- yiisoft/yii2-gii: ^2.0
This package is auto-updated.
Last update: 2024-09-25 13:13:26 UTC
README
使用Yii2创建RESTful API以部署在Google App Engine (标准环境)上
支持
- 响应xml和json格式
- 实现版本控制
- 使用.env文件在服务器和本地之间进行配置
- 通过app-engine使用memcache
安装
git clone https://github.com/prawee/yii2-gae-api
cd yii2-gae-api
composer install
配置
更新本地环境变量
cp .env.dist .env
更新GAE环境变量
cp app.yaml.dist app.yaml cp cron.yaml.dist cron.yaml
在本地更新配置
cp config/main-local.php.dist config/main-local.php
运行
localhost
php -S localhost:8080 -t public
使用Google App Engine的localhost
dev_appserver.py app.yaml
查看
# local
GET localhost:8080/requirements.php
GET localhost:8080/site
GET localhost:8080/v1/users
# gae GET https://<project-id>.appspot.com/requirements.php GET https://<project-id>.appspot.com/site GET https://<project-id>.appspot.com/v1/users