prawee/yii2-gae-api

使用Yii2创建RESTful API以部署在Google App Engine上

安装: 6

依赖: 0

建议者: 0

安全: 0

星标: 5

关注者: 2

分支: 2

开放问题: 0

类型:项目

1.0 2019-03-15 10:39 UTC

This package is auto-updated.

Last update: 2024-09-25 13:13:26 UTC


README

使用Yii2创建RESTful API以部署在Google App Engine (标准环境)

支持

  1. 响应xml和json格式
  2. 实现版本控制
  3. 使用.env文件在服务器和本地之间进行配置
  4. 通过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