Menu

1 / 2

NestJS for beginners

DEV Community·FLUX·6 months ago
#HALxm54c
#controller#why#module#understanding#user
Reading 0:00
15s threshold

What is NestJS ?

Nest is framework to build efficient, scalable Node.js server side applications. We can simply use Typescript and concepts like OOPS, Functional Programming are very basic things you should know.

Why to use Nestjs ?

NestJS is built around modularity thus it can organize the code into separate modules, making it easier to understand, maintain and scale.

Connect

Repository

Table of Contents

Controller and services 2.1 [Controller] 2.2 [Services]

1. Basics

Setting up project

$ npm i -g @nestjs/cli $ nest new project-name

Enter fullscreen mode

Exit fullscreen mode

This is sufficient to setup our NestJS project which would give us few node modules along with some boilerplate files, an 'src' directory with core files.

src |_app.controller.spec.ts |_app.controller.ts |_app.module.ts |_app.service.ts |_main.ts

Enter fullscreen mode

Exit fullscreen mode

app.controller.ts : Basic controller with single route app.controller.spec.ts : Unit tests for controller app.module.ts : Root…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.