How to use Node.js 0.8.x domains with express?

后端 未结 5 655
旧时难觅i
旧时难觅i 2021-02-01 19:34

How can I create Express/Connect middleware which wrap each request in its own domain?

5条回答
  •  不要未来只要你来
    2021-02-01 19:48

    The domains are currently deprecated in node:

    https://nodejs.org/api/domain.html

    For the purpose of 'zoning errors', I've created a library which allows you to write asynchronous code in a nice way: https://github.com/vacuumlabs/yacol . One of its benefits is that you can have domains-like behavior with a very nice semantics; check it out!

提交回复
热议问题