Express, with architecture
Express gives you freedom — and big Express apps often become a tangle. NestJS builds on Express with a clear structure borrowed from Angular and Java's Spring: modules, controllers, services, dependency injection and decorators. Large teams love it because every Nest app looks familiar.
Bootstrap, module, controller
import { Controller, Get, Module } from "@nestjs/common";
import { NestFactory } from "@nestjs/core";
@Controller()
class AppController {
@Get()
hello() {
return { message: "Namaste from Nest" };
}
}
@Module({ controllers: [AppController] })
class AppModule {}
async function bootstrap() {
const app = await NestFactory.create(AppModule);
await app.listen(3000);
console.log(await (await fetch("http://localhost:3000/")).json());
}
bootstrap();- Start a real project with npm i -g @nestjs/cli then nest new cafe-api.
- Under the hood Nest uses Express (or Fastify) — everything from the Node course still applies.
- Decorators need experimentalDecorators and emitDecoratorMetadata in tsconfig — the CLI sets them up.