​Hapi.js 12.0.0 发布,Node.js 服务端框架

2016年01月19日

Hapi.js 是一个用来构建基于 Node.js 的应用和服务的富框架,使得开发者把重点放在便携可重用的应用逻辑而不是构建架构。内建输入验证、缓存、认证和其他 Web 应用开发常用的功能。

hapi v12.0.0 主要移除了 qs 模块的框架依赖。qs 是一个 URL 查询字符串解析器,支持特定的复杂结构。此版本最大的贡献者是 Sideway

非兼容改进:

  • Removed support for the processing of special form-encoded key=value pairs in query strings, form-encoded payloads, and multipart field names.

  • Removes the connection query.qs configuration option.

  • Removes the route payload.qs configuration option.

  • Removes the parserOptions argument from the request.setUrl() method.

  • Authentication scope strings cannot begin with ! or + as those prefix characters now have a special meaning.

  • request.route (the route public interface) settings.auth changed to move scope and entity inside a new access array.

  • When using server.inject(), any HTTP trailers are no longer included in res.headers but instead are provided under res.trailers to be consistent with node.

  • Removed request.session and request.auth.session placeholders (was set to null before).

新特性:

  • Allow passing a pre-processed URL object (from node's URL parse()) to request.setUrl().

  • Support new required and forbidden authentication scopes.

  • Allow specifying multiple scope/entity sets for a single endpoint.

  • New pendingGenerateTimeout cache option for reducing calls to the generate method while another is already pending.

  • Return a Promise when a callback is not provided.

  • Expose CORS origin match status in request.info.cors.isOriginMatch.

  • Expose entire request.auth object in validation context.

详细改进内容请看发行说明

展开阅读全文
28 收藏
分享
加载中
最新评论 (12)
好像写 nodejs 是多麻烦的事,这框架那框架,写 java 写傻了。自己写了个项目,拉出公用的部分,起个名 xxx 框架
2016-01-20 19:06
0
回复
举报
[吐舌]
2016-01-19 20:15
0
回复
举报
2016-01-19 16:27
0
回复
举报
2016-01-19 16:26
0
回复
举报
1
2016-01-19 16:09
0
回复
举报

引用来自“踏浪溯缘”的评论

20
1
2016-01-19 15:56
0
回复
举报
20
2016-01-19 15:55
0
回复
举报

引用来自“踏浪溯缘”的评论

毛血旺啊

引用来自“踏浪溯缘”的评论

毛血旺啊
毛血旺啊
2016-01-19 15:52
0
回复
举报

引用来自“踏浪溯缘”的评论

毛血旺啊
毛血旺啊
2016-01-19 15:52
0
回复
举报
毛血旺啊
2016-01-19 15:52
0
回复
举报
更多评论
12 评论
28 收藏
分享
返回顶部
顶部