-
-
Notifications
You must be signed in to change notification settings - Fork 685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
运行时上下文是否可以加入原生req? #290
Comments
其实是可以考虑直接使用原生 req,这块应该没什么问题。 |
原生req有一个好处是,可以直接用现成的一些轮子去做一些事情。 我觉得作为一个补充手段其实是非常实用的 |
有道理, 能具体举例子吗,方便理解 |
比方说我有一个koa应用。那我就可以直接使用 koa.callback()(req, res) 来直接把现成的应用集成到 laf 中 这是一个vercel的case |
这个需求很有价值,有几个疑问要请教:
最重要的是,使用 koa req interface,未来是否还会面临此 interface 的调整, 会再次面对 问题(3),存量生态产物的处理是关键问题。 |
首先不是要切换koa。 建议使用node http 的 req对象。完整的名字我记得叫 incomingrequest(可能不对) 。因为所有的框架都需要兼容这个对象的数据(基于这个的原始数据来解析) express的req对象是集成自nodejs的原生req对象的。这个没有问题。 建议是额外增加req的暴露(反正都暴露res了),这个是增加更新,不会对现有的项目产生break change的吧 |
了解,认同 extra req 的方式,没有 break change。 |
@moonrailgun 是否考虑直接给 app-service 提 pr 增加 native req? |
Signed-off-by: maslow <wangfugen@126.com>
不清楚是否刻意没有加入?
The text was updated successfully, but these errors were encountered: