Skip to content

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:

  1. the new HTTP endpoints are served, and
  2. the client SDKs are regenerated, when the app calls setupCodegen as it starts.

With the Nest CLI ​

bash
npx nest start --watch

Nothing else is needed.

With Node and a TypeScript loader ​

bash
node --watch --import @swc-node/register/esm-register src/main.ts
bash
node --watch --import @oxc-node/core/register src/main.ts

Also 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',
});

Released under the MIT License.