Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lhkzh/play_node
https://github.com/lhkzh/play_node
Last synced: 23 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/lhkzh/play_node
- Owner: lhkzh
- License: other
- Created: 2022-10-31T11:54:15.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-25T03:26:33.000Z (over 1 year ago)
- Last Synced: 2024-12-12T14:09:52.088Z (27 days ago)
- Language: TypeScript
- Size: 251 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
说明:
轻量级api手脚架
-
**特性**
- (基于Typescript&Decorator)编写
- 注解配置路由、参数规则、输出格式、权限判断
- 自动生成简单的在线接口文档(需要按照规则写注释快速使用
npm install -g create-pn_apicreate-pn_api create ProjectName
cd ProjectName
npm start
注意可选项
//接口请求日志输出
Facade._hootDebug = console.log;
//接口错误输出
Facade._hookErr = (ctx,err)=>{ console.error(ctx.getPath(), err); };//添加msgpack编码支持
Facade._msgpack = {encode:require("@msgpack/msgpack").encode, decode:require("@msgpack/msgpack").decode};
//添加xml编码支持
const fxp = require("fast-xml-parser");
const fxp_parser = new fxp.XMLParser();
const fxp_builder = new fxp.XMLBuilder();
Facade._xml = {encode:fxp_builder.build.bind(fxp_builder), decode:fxp_parser.parse.bind(fxp_parser)};https://github.com/lhkzh/play_node