Development
Run the app with one of these while you work on it. They make the routers pick up the endpoint files you add, rename or delete, so that:
- the new HTTP endpoints are served, and
- the client SDKs are regenerated, when the app calls
setupCodegenas it starts.
With the Nest CLI
bash
npx nest start --watchNothing else is needed.
With Node and a TypeScript loader
bash
node --watch --import @swc-node/register/esm-register src/main.tsbash
node --watch --import @oxc-node/core/register src/main.tsAlso turn on watch in NestjsEndpoints.forRoot. node --watch restarts only for files the app has already loaded, and watch makes it restart for a new endpoint file too:
ts
NestjsEndpoints.forRoot({
router: { rootDirectory: './endpoints' },
watch: process.env.NODE_ENV === 'development',
});