SOFA:创建REST API的最佳方法 从GraphQL Server生成RESTful API 源码
创建REST API的最佳方法(是GraphQL)。 安装 yarn add sofa-api # or npm install sofa-api 入门 这是不依赖框架的完整示例,但也可以与任何框架集成: import http from 'http' ; import getStream from 'get-stream' ; import { createSofaRouter } from 'sofa-api' ; const invokeSofa = createSofaRouter ( { basePath : '/api' , schema , } ) ; const server = http . createServer ( async ( req , res ) => { try { const response = await invokeSofa
下载地址
用户评论