mingyang_http
v2024.2.4
Published
simplified and efficient httpServer component
Downloads
63
Maintainers
Readme
introduction
- 精简高效的httpServer组件,体积小巧,运行高效,代码简单,支持multipart/form-data格式,支持通配路由,支持路由变量,能完美运行在 (aliyun FC / tencent SCF) 中,使用最小内存选项即可。
- simplified and efficient httpServer component, small size, efficient operation, simple code, support multipart/form-data format, support wildcard routing, support routing variables, works perfectly in (aliyun function compute) and (tencent cloud serverless cloud function), minimum memory can be used.
environment
- 1 General Node(nodejs)
- 2 Aliyun FC (aliyun function compute)
- 3 Tenyun SCF (tencent cloud SCF Node)
run
- 1 NodeJS(on os)
run “sample_bin.js directly(need to set environment variable develoment=true or delete related code in sample_bin.js)
- 2 Aliyun FC (aliyun function compute)
setup:function>setting>functing entry to “sample_bin.requestForAliyun”(its default value generally is index.handler)
- 3 Tenyun SCF (tencent cloud SCF Node)
setup:function>setting>functing entry to “sample_bin.requestForTenyun default value generally is index.main_handler)
test
- 查看original message和匹配的router,router-variable
- View original message and matching router,router-variable http://localhost:9090/root/path?key0=value0&key1=value1
- 返回1234的62进制形式
- Returns 1234 in base 62 http://localhost:9090/base62/1234
- 返回从【2023-01-01到现在】的时间戳的62进制形式
- Returns the base 62 form of the timestamp from [2023-01-01 to present] http://localhost:9090/base62/2023/
- 返回10个time开头的有字母ID(有分段符)
- Returns 10 alphabetic IDs starting with time (with segment characters) http://localhost:9090/timeid/10
- 返回20个time开头的有字母ID(无分段符)
- Returns 20 alphabetic IDs starting with time (no segment characters) http://localhost:9090/timeID/20
- 返回30个time开头的全数字ID(有分段符)
- Returns 30 numeric IDs starting with times (with segment characters) http://localhost:9090/timeno/30
- 返回40个time开头的全数字ID(无分段符)
- Returns 40 numeric IDs starting with times (no segment characters) http://localhost:9090/timeNO/40
- 其它路由
- other router http://localhost:9090/insert/abcd?key=value
- 其它路由
- other router http://localhost:9090/select/abcd?key=value
history
- 2023-08-26
- 去掉了post和put时候 强制要求content-length大于0的要求
- removed the requirement that content-length be greater than 0 when post and put are mandatory
- 未配置 允许的content-type 的情况下,那么允许所有的
- if the allowed content-type is not configured, all are allowed
- 优化一些http状态码的提示语
- optimized some http status code prompts
- 增加了示例代码 sample_bin:入口文件; sample_router:路由文件
- added sample file sample_bin:entry file; sample_router:router file
- 2023-10-13
- 去掉了对mingyang_data包的依赖
- removed the dependency on the mingyang_data package
- request在任何情况下都有字段routerVariable
- in any case there is a field routerVariable
- 2024-01-17
- 适配了腾讯云SCF
- adapted to tencent cloud serverless cloud function
- 2024-02-04
- 优化了body中的代码
- optimized the code in the body
- 优化了示例代码
- optimized the sample code (sample_bin.js and sample_router.js)
author
- fujun wang([email protected])
- Wangjing Beijing China
- origin of the name : mingyang is my son's name
- last modified : 2024-02-04