@serverless-devs/http-json-body-parser

0.0.4-alpha.38 • Public • Published

设计原则

Fc 函数计算的参数格式为(req, res, context)。第一个参数 req 的参数类型为 readable Stream。将 req 转换为 JSON Object 的类型

基础使用方式

'use strict';
const dk = require('@serverless-devs/dk-core');
const jsonBodyParser = require('@serverless-devs/http-json-body-parser');

const handler = dk((request) => {
  return { body: 'hello world' };
});

handler.use(jsonBodyParser());

exports.handler = handler;

高级使用方式

/@serverless-devs/http-json-body-parser/

    Package Sidebar

    Install

    npm i @serverless-devs/http-json-body-parser

    Weekly Downloads

    0

    Version

    0.0.4-alpha.38

    License

    ISC

    Unpacked Size

    16.3 kB

    Total Files

    10

    Last publish

    Collaborators

    • serverlessfans
    • heimanba
    • xsahxl