Migrate existing express application incrementally to NestJS

Viewed 616

we do have an existing express/graphql-yoga server that in its nature is quite simple yet has been customised here and there to fit our needs. As the application grows we'd like to move to a more opinionated approach to structuring it and considered NestJS as a viable alternative. I am wondering what the best strategy to migrate would be. In fact, I see two options:

  1. Migrate the HTTP server layer to NestJS while keeping the existing services intact and them migrate them piece by piece
  2. Migrate the services themselves to modules first and then eventually migrate the HTTP server layer later (using https://docs.nestjs.com/standalone-applications as a reference) - however I haven't figured out yet to request-scope an existing standalone IoC container yet.

I'd love to get some feedback/pointers from the community on this abstract question. Especially since I am kinda stuck now at approach no. 2 as I haven't managed to scope the container yet.

Thanks!

0 Answers
Related