Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Building (preparing) node.js application for production (deploy)

Building (preparing) node.js application for production (deploy)


I have a project that consists of several nod.js backend applications. The apps are using the same modules (which a placed outside of each ap folder in shared location). The aps they are to be deployed on differnt environments (servers), some code is for test, some for debug as usual.

If I choosed a platform (for example PaaS nodejitsu) for one of my apps, how I'm supposed to send there only Production code for one of my apps? I deployed on nodejitsu and it just sends the app folder and uses package.json to configure the app. But there are a bunch of code that is not need (tests) for example and some code is external. And what If I want to obstruct server code too? How this issues are supposed to be soleved?

For front-end applications has a tons of methods to be build for production. I understand that the requirements are different, but didn't find any infromation on best practices fo how correctly to prepare node.js back end application for deploy.

Problem courtesy of: WHITECOLOR


Add those test files in .gitignore

or make another branch for production in git and push the production branch.

Solution courtesy of: InspiredJW


View additional discussion.

This post first appeared on Node.js Recipes, please read the originial post: here

Share the post

Building (preparing) node.js application for production (deploy)


Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription