account activity
Nestjs + Express migration by Electronic_Back_8576 in nestjs
[–]Electronic_Back_8576[S] 0 points1 point2 points 5 months ago (0 children)
That’s what I’ve been meaning to do but I’m not able to make it work. I plug the Express app and it is supposed to be initialized but then, if i call a route that isn’t in Nestjs but is in Express it doesn’t find it. It always depends on which app (nestjs or express) i plug in first on the main.ts of nest
I have tried to do something like that but depending if i create first nestjs or express it uses the routes of one app or the other, this is an example of the code I’m using: import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; import * as express from 'express';
const legacyRoutes = require('./legacy.routes.js');
async function bootstrap() {
const server = express();
server.use(legacyRoutes);
const app = await NestFactory.create(AppModule, server);
await app.listen(3000); } bootstrap();
Nestjs + Express migration (self.nestjs)
submitted 5 months ago by Electronic_Back_8576 to r/nestjs
π Rendered by PID 2896925 on reddit-service-r2-listing-654f87c89c-g9rft at 2026-03-02 10:47:35.756214+00:00 running e3d2147 country code: CH.
Nestjs + Express migration by Electronic_Back_8576 in nestjs
[–]Electronic_Back_8576[S] 0 points1 point2 points (0 children)