GithubHelp home page GithubHelp logo

wxcloud1's Introduction

wxcloudrun-thinkphp

GitHub license GitHub package.json dependency version (prod)

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

快速开始

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

目录结构说明

.
├── Dockerfile                  Dockerfile 文件
├── README.md                   README 文件
├── app                         应用目录
│   ├── controller              控制器目录
│   ├── model                   模型目录
│   └── view                    视图目录
├── conf                        配置文件
│   ├── fpm.conf                fpm 配置
│   ├── nginx.conf              nginx 配置
│   └── php.ini                 php 配置
├── config                      thinkphp 配置
├── container.config.json       微信云托管流水线配置
├── public                      WEB目录(对外访问目录)
│   ├── favicon.ico             图标
│   ├── index.php               入口文件       
│   └── router.php              快速测试文件 
├── route                       路由文件			
│   └── app.php                 定义应用路由
├── run.sh                      nginx、fpm 启动
├── runtime                     应用的运行时目录(可写,可定制)
├── think                       命令行入口文件
└── vendor                      第三方类库目录

服务 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

wxcloud1's People

Watchers

 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.