ppeco/apipp

API后端库

1.1.1 2021-07-26 12:41 UTC

This package is auto-updated.

Last update: 2024-09-26 19:51:23 UTC


README

简化API编写的库

安装方法

composer require ppeco/apipp

示例

use apipp\ApiPP;

require_once "vendor/autoload.php";

ApiPP::create()
    ->method("hello_world", function(ApiPP $apiKit) {
        return "Hello, world!";
    })
    ->method("hwp", function(ApiPP $apiKit) {
        [$someKey] = $apiKit->get(["key"]);
        return "Key: $someKey";
    })
    ->start();