Skip to main content

@nessframework/nest

@nessframework/nest integrates a NestJS 11 application into Ness development and production servers.

Installation​

New Ness applications include the integration. Add it to an existing application with:

ness add @nessframework/nest
npm install @nestjs/common@11.1.28 @nestjs/core@11.1.28 reflect-metadata@0.2.2 rxjs@7.8.2

Unified integration​

ness.config.mjs
import { defineNessConfig } from '@nessframework/router';
import { ness } from '@nessframework/router/vite';
import nest from '@nessframework/nest';
import { nestServer } from '@nessframework/nest/server';

export default defineNessConfig({
vite: { plugins: [ness({ plugins: [nest()] })] },
server: { configureServer: nestServer({ prefix: 'api' }) },
});

The Vite integration discovers app/server/app.module.ts β€” .mts and .js are accepted too β€” compiles Nest decorators and metadata, mounts controllers during development, and watches backend sources. Build output is written to build/nest; the production bridge mounts it on the existing Ness server, so no secondary port or proxy is required.

The route prefix defaults to api and must remain non-empty, preserving React Router fallthrough for every URL outside the Nest namespace.

nest() also accepts source (the backend directory, default app/server), outDir (default build/nest), and logger, the Nest log levels to enable. nestServer() accepts the same prefix and logger, plus module β€” the compiled entry to load, default build/nest/app.module.js β€” when the plugin was built to a different outDir.

See NestJS backend for controllers, services, modules, DI, and CLI generators.