Change the interface for setting application settings

未关闭
#4,099 5 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
领域
api, backend

调研方向

首先追踪现有的 app.set(, ) 和 app.get() 接口,包括它们与 router 形式的 app.get(path, callback) 之间的重叠。确定 app.settings getter-setter 行为的范围以及在主版本中移除 settings 形式的范围,然后在相关测试中验证由此产生的接口和兼容性预期。

由索引模型根据 Issue 内容生成。

描述

5.x enhancement

The interface app.set(<name with space>, <value>) feels a odd for setting values in a JavaScript framework. Also, its counterpart app.get(<name>) is a confusing twin of app.get(path, callback [, callback ...]), which is a router method.

I am proposing to implement application settings using getter-setter interfaces.

app.settings.trustProxy = true;

And get rid of app.get(<name>).

Super major change, I know, but the next major version is a good time to make these interface improvements.

Related issues

  1. https://github.com/expressjs/express/issues/2216
  2. https://github.com/expressjs/express/issues/3997
主要语言
JavaScript
星标
69.7k
派生
25.6k
平均合并
2 天 9 小时
30 天内合并 PR
4

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

expressjs/express 的其他 Issue

查看 expressjs/express 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。