Module 4 - Deployment and Best Practices

Objectives

Environment Variables

When you develop and run code on your machine, you run code in its development environment.

Most companies will have a testing environment similar to production; it has the same versions of software and runs on similar, albeit weaker, hardware. They do this to mitigate the risks when moving the to production servers that clients use.

Ideally, all environments run on the same stack, platforms, and versions. Still, it is common to have developers on the Windows platform with the latest version of Node.js and the production server running on Linux with the last stable version of Node.js. For those cases, it is essential to have a testing/staging environment that also runs the Linux and Node.js versions found on the production server. A staging environment can detect any regressions that may occur during deployment before code reaches the user.

Challenge

Extract all secrets and values that need to change between development and production environments.

Guided Project

Project Resources

Important Notes

As of November 2022 Heroku does not provide a totally free tier like they used to, so we do not expect you to use their services. We only need you to understand how to make an API deployable to Heroku or similar providers.

The versions of project dependencies used in the recording are slightly different from the ones used in the starter and solution repositories, but this should not affect the relevant code of the Guided Project.

The versions used in the repositories are more recent, and thus more similar to the versions you will install if you create a project from scratch.

Assignment

Project Resources