Simple question:
In regards to Express's generator, what is the purpose and benefit behind abstracting app.listen()
out of the app.js file and into the ./bin/www
file ?
This makes the app easily testable with supertest , for one thing. This way you can leave your dev server running and still run tests without worrying about TCP port conflicts.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.