返回介绍

Express 实用模板

发布于 2020-12-20 08:19:48 字数 2757 浏览 1202 评论 0 收藏 0

Express utility functions

The pillarjs GitHub organization contains a number of modules for utility functions that may be generally useful.

Utility modulesDescription
cookiesGet and set HTTP(S) cookies that can be signed to prevent tampering, using Keygrip. Can be used with the Node.js HTTP library or as Express middleware.
csrfContains the logic behind CSRF token creation and verification. Use this module to create custom CSRF middleware.
finalhandlerFunction to invoke as the final step to respond to HTTP request.
parseurlParse a URL with caching.
path-matchThin wrapper around path-to-regexp to make extracting parameter names easier.
path-to-regexpTurn an Express-style path string such as ``/user/:name` into a regular expression.
resolve-pathResolves a relative path against a root path with validation.
routerSimple middleware-style router.
routingtonTrie-based URL router for defining and matching URLs.
sendLibrary for streaming files as a HTTP response, with support for partial responses (ranges), conditional-GET negotiation, and granular events.
templationView system similar to res.render() inspired by co-views and consolidate.js.

For additional low-level HTTP-related modules, see jshttp .

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文