How to deploy a NestJS Application in Heroku using GitLab CI/CD pipelines

Introduction

In previous days I wrote a little tutorial explaining how to create a NestJS application  Create an API Rest With NestJS and PostgreSQL and now I will explain how to deploy it using GitLab Pipelines.

Prerequisites

We need to create an account in  Heroku and  GitLab.

Please make sure that Node.js (>= 10.13.0) is installed on your operating system.

Installation

NestJS

Once installed NodeJS we doing to install  NestJS CLI, Command Line Interface that help us to maintain our application.

Once installed, we going to execute the next command to create our project.

$ nest new project-name

You can find the core files in the src directory.

Core files

  • app.controller.ts: A basic controller with a simple route.
  • app.service.ts: A simple service.
  • app.module.ts: The root module of the application.
  • main.ts: The entry file of the application which uses the core function NestFactory to create a Nest application instance.

#javascript #heroku #devops #nestjs

Deploy A NestJS Application in Heroku with GitLab CI/CD Pipelines
5.85 GEEK