Skip to content

Behind the Codes

Introduction to NestJS

NestJS1 min read

If you're a backend JavaScript developer, chances are you have created a Node.js application with Express, Koa, or any other frameworks or libraries. Overtime, you might have noticed that it became increasingly difficult to maintain because the codebase just keeps getting larger.

Introduction

NestJS

In this post, I'm going to introduce you to NestJS, a progressive Node.js framework for building efficient, reliable, and scalable server-side applications. It is deeply inspired by Angular and written on TypeScript. So if you're familiar with Angular, it's gonna be pretty easy for you to pick up. Behind the scenes, NestJS actually uses Express or Fastify, depending on your configuration. It provides an abstraction above these frameworks.

Setting up NestJS

You can install NestJS CLI using:

$ npm i -g @nestjs/cli

Then, create a new NestJS project with:

$ nest new <project_name>

Go to the project directory and run your project with:

$ npm start
// or
$ npm run start
// or
$ npm run start:dev

Open your web browser, point to http://localhost:3000/ and voila!

Congratulations! You just created an app using NestJS!

© 2021 by Behind the Codes. All rights reserved.
Theme by LekoArts