I'm trying to create an app which listens to http and https. According to the docs https://docs.nestjs.com/faq/multiple-servers, it specifies how to create such servers using express, however there is no mention how to do it correctly with fastify. I figured it could be done exactly the same way using fastify, however there is type errors when I pass fastify server to https and https create server functions.
According to this answer (tho it didn't get many upvotes but the only I could fine about that matter) https://stackoverflow.com/questions/58941575/what-is-the-correct-implementation-for-multiple-simultaneous-servers-when-runnin, he suggests creating two applications where nestjs resolves the dependencies twice, and if you set more stuff on your app, you need to duplicate everything.
I'd appreciate if anyone knows a classic way of doing it similar to express, and maybe we can add it to the docs for extra clarification.
Thanks!
Nest is a framework for building efficient, scalable Node.js server-side applications. It uses progressive JavaScript, is built with TypeScript and combines elements of OOP (Object Oriented Progamming), FP (Functional Programming), and FRP (Functional Reactive Programming).