Giter Site home page Giter Site logo

toy-wxcloud's Introduction

wxcloudrun-laravel

GitHub license GitHub package.json dependency version (prod)

微信云托管 Laravel 框架模版,实现简单的计数器读写接口,使用云托管 MySQL 读写、记录计数值。

快速开始

前往 微信云托管快速开始页面,选择相应语言的模板,根据引导完成部署。

目录结构说明

.
├── Dockerfile                  Dockerfile 文件
├── LICENSE                     LICENSE 文件
├── README.md                   README 文件
├── app                         应用目录
├── artisan                     artisan
├── bootstrap                   框架的启动和自动载入配置
├── composer.json               composer 文件
├── composer.lock               composer 文件
├── conf                        配置文件
│   ├── fpm.conf                fpm 配置
│   ├── nginx.conf              nginx 配置
│   └── php.ini                 php 配置
├── config                      应用所有的配置文件   
├── container.config.json       微信云托管流水线配置
├── database                    数据库迁移文件及填充文件
├── public                      应用入口文件 index.php 和前端资源文件
├── resources                   应用视图文件和未编译的原生前端资源文件
├── routes                      应用定义的所有路由
├── run.sh                      镜像启动脚本
├── server.php                  命令行入口文件       
├── storage                     存放框架生成的文件和缓存
└── webpack.mix.js

服务 API 文档

GET /api/count

获取当前计数

请求参数

响应结果

  • code:错误码
  • data:当前计数值
响应结果示例
{
  "code": 0,
  "data": 42
}

调用示例

curl https://<云托管服务域名>/api/count

POST /api/count

更新计数,自增或者清零

请求参数

  • actionstring 类型,枚举值
    • 等于 "inc" 时,表示计数加一
    • 等于 "clear" 时,表示计数重置(清零)
请求参数示例
{
  "action": "inc"
}

响应结果

  • code:错误码
  • data:当前计数值
响应结果示例
{
  "code": 0,
  "data": 42
}

调用示例

curl -X POST -H 'content-type: application/json' -d '{"action": "inc"}' https://<云托管服务域名>/api/count

License

MIT

toy-wxcloud's People

Watchers

James Cloos avatar mozatkey avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.