nodejs express 3.0

孤者浪人 提交于 2019-12-23 04:20:20

问题


I have a nodejs express 2.0 application and I want to use express 3.0 within it. Tell me please which is state of express 3.0 at now and is there examples of express 3.0 applications?

I saw connect 2.0 has been released, so can I use it with express 2.0 ?


回答1:


I have had the same issue myself with my applications after doing npm install express .

TJ has upgraded version 3 and added/removed some features (better or for worse Im still ascertaining :P )

But the 2 things you need to MAKE sure to change on a default application is change:

app.register..

to:

app.engine

And to know that dynamicHelpers and helpers are no longer there. You have to use

app.locals.use

Strongly recommend reading his migration guide:

https://github.com/visionmedia/express/wiki/Migrating-from-2.x-to-3.x

TJ has had some of his examples updated (and in the process of updating others) which I found a good helper to picking it back up

https://github.com/visionmedia/express/



来源:https://stackoverflow.com/questions/10204055/nodejs-express-3-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!