Setup and First App

Install the Nest CLI and Create a Project

You need Node.js 20 or later. Install the CLI globally and create a new project:

Example

npm i -g @nestjs/cli
nest new shopease-api
cd shopease-api
npm run start:dev

Example output

? Which package manager would you ❤️  to use? npm
✔ Installation in progress... ☕
🚀  Successfully created project shopease-api

[Nest] 18432  - 15/01/2026, 10:00:00     LOG [NestFactory] Starting Nest application...
[Nest] 18432  - 15/01/2026, 10:00:00     LOG [InstanceLoader] AppModule dependencies initialized +12ms
[Nest] 18432  - 15/01/2026, 10:00:00     LOG [RoutesResolver] AppController {/}: +4ms
[Nest] 18432  - 15/01/2026, 10:00:00     LOG [RouterExplorer] Mapped {/, GET} route +3ms
[Nest] 18432  - 15/01/2026, 10:00:00     LOG [NestApplication] Nest application successfully started +2ms

Call the Default Endpoint

Example

curl -i http://localhost:3000/

Example output

HTTP/1.1 200 OK
X-Powered-By: Express
Content-Type: text/html; charset=utf-8
Content-Length: 12

Hello World!
ScriptWhat it does
npm run startCompile and run once
npm run start:devWatch mode: restarts when you save a file
npm run buildCompile TypeScript to dist/
npm run start:prodRun node dist/main (production)
npm test / npm run test:e2eUnit tests / end-to-end tests with Jest