rousi/apigw-request-factory 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

rousi/apigw-request-factory

最新稳定版本:1.0.1

Composer 安装命令:

composer require rousi/apigw-request-factory

包简介

PSR Request Factory from aws-based API Gateway Request

README 文档

README

A library for creating a psr-based request based on data passed from the gateway api to the function, as well as for generating a response from a psr-based response.

Installation

You can install this library via Composer. To do this, simply run the following command in your working directory:

composer require rousi/apigw-request-factory

Usage

Example of the function entry point code for "Yandex Cloud Functions":

<?php

use Apigw\ServerRequestFactory;
use Apigw\ResponseEmitter;
use Nyholm\Psr7\Factory\Psr17Factory;

function handler($event, $context)
{
    // Creating a psr-based request from an event
    $request = ServerRequestFactory::from($event);
    // Creating a psr-based response
    $response = (new Psr17Factory)->createResponse(200);

    // Here is your code!

    return ResponseEmitter::emit($response);
}

License

This library is distributed under the MIT License. Please refer to the LICENSE file for more information.

统计信息

  • 总下载量: 11
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-09-22