title: Migrating Express application to NestJS
body: <p>I have an existing express application, and it is large enough. I want to migrate it to NestJS application, but do it step by step. So I have created Nest app with an existed Express instance, by faced a problem - all nest handlers always add after Express handlers. But I have a root  Express middleware I want to apply only for some handlers that go after it. How can I apply Nest handlers before Express handlers?</p>
  <p>For example. I created a new NestJS project, and changed main.ts</p>
  <pre><code>import { NestFactory } from '@nestjs/core';
  import { AppModule } from './app.module';
  import { ExpressAdapter } from '@nestjs/platform-express';
  import * as express from 'express';
  
  const expressApp = express();
  const authMiddleware = (req, res) =&gt; res.end('Auth middleware');
  expressApp.use(authMiddleware);
  expressApp.get('/test', ((req, res) =&gt; res.end('Test')))
  
  async function bootstrap() {
    const app = await NestFactory.create(AppModule, new ExpressAdapter(expressApp));
  
    await app.listen(3000);
  }
  bootstrap();
  </code></pre>
  <p>On the root path I expect to see <strong>Hello World!</strong> but I see <strong>Auth middleware</strong></p>
  <p>I understand that I can do something like</p>
  <pre><code>expressApp.get('/test', authMiddleware, ((req, res) =&gt; res.end('Test')))
  </code></pre>
  <p>But current project is too large with sub routers and not only one middleware. Maybe there is another way to do it right?</p>