Just do it. Nike!

Just doing it to get work done.

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Deploying a NestJS App With Heroku

Deploying a NestJS application with Heroku is an easy possibility to host your application. This tutorial is a step-by-step guide for deploying small (side) projects by using GitHub and the Heroku web app (without the CLI). I deployed my Animal Crossing GraphQL application this way.

I assume that you already have:

If you don’t already have a .gitignore file, create one in the root folder of your project and add the following lines:

This ensures that you don’t commit these files to Git, preventing build artifacts from getting into your GitHub repository.

Heroku needs to know the version of your Node.js runtime, to be able to run it on Heroku. You can check for your node version by running this command in your terminal:

Now add this to your package.json (if you are running e.g. on version 14.16.1):

If you already started your app you should be familiar with the npm run start script. If you used the NestJS CLI command nest new <project-name> for creating your project you should have the following start scripts in your package.json:

When running your app a dist folder with a main.js file is created, which is used for the deployment. You can leave this like this, as this already works perfectly for simple projects.

“Heroku apps include a Procfile that specifies the commands that are executed by the app on startup.”…

Add a comment

Related posts:

12. About suddenly

People start living in houses and they start seeing houses as people. Houses start living with people and they start believing them to be houses. People are just like moving houses, one of them had…

Covid Conversations During Confinement

Because we are not only confined to the house for five days or whatever time frame Biden has determined the new quarantine period to be. We are confined to the only room in the house that has not…

What Do I Love About Myself the Most?

I had to take a moment and truly ask myself that question and find answers about it because I couldn’t tell you off the top of my head. This is because I don’t love myself, well I didn’t, so finding…