Unit 8. Deploying and managing code in production

At just about any stage of your application development, you likely wonder when people can start using what you’ve built. The eagerness is justified. Luckily, you have many ways to get your application online. Deploying an application is one of the most daunting tasks for new developers building web applications. Part of the struggle is understanding the resources and services that assist with deployment. The deployment process is much more than uploading your application code somewhere, at least during your first attempt. If done correctly, making changes in a production application can be simple. Some problems with making changes in your production application include running into restrictions that limit the database content that you can modify, accidentally removing code used to verify incoming data, and making changes in your local environment that don’t work in your production environment, such as configuration changes.

In this unit, you set up your application to deploy on Heroku, a cloud service that hosts and runs your application for you. First, you prepare your application’s configuration files to ensure that functionality will work locally and in production. Then you follow a few steps to launch your application on Heroku and set up your MongoDB database. After a short lesson, you’ll have your recipe application running under a URL that you can share with family and friends. In a subsequent lesson, you explore ways to improve your code for future refinement. I talk about linting your code, a process used to identify inefficient code with the help of an external package. At the end of the unit, you’ll get a chance to apply unit and integration testing to your code. These tests provide fundamental protection against accidentally breaking your code in the future. You install the mocha and chai packages to help set up tests for Express.js actions and routes.

This unit covers the following topics:

  • Lesson 34 guides you through the preparation steps to complete before your application is production-ready. In this lesson, you set up your application to deploy to Heroku along with a new MongoDB database provided as a plugin on Heroku’s services.
  • Lesson 35 shows how to catch small bugs in your code through the linting process and how to correct those bugs with the help of a debugging tool. By the end of this lesson, you’ll have a set of tricks to pull out of your back pocket whenever you need to clean up your code.
  • Lesson 36 introduces testing concepts in Node.js. This lesson touches the surface of test code you can write to ensure that functionality in your application doesn’t break over time.

Lesson 37 (the capstone lesson) walks through using the deployment steps you learned in this unit to deploy the Confetti Cuisine application.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset