Hi Ayush, thanks for taking the time to go through it.
In theory, you can have an HTTP service AND a microservice inside the same project, in NestJs there's a main.ts file that works as an entry point, that's where you usually start the app (whether it's an express HTTP server or a microservice), you can modify the main.ts file so it runs both.
Now, my recommendation is to have 2 NestJs applications:
Microservice (Let's call it MS-1)
HTTP server using express that registers MS-1. (Like I did for the API Gateway of the article)
This way you can "send stuff" to your Microservice using an HTTP Service. Is there a practical reason you can't have the two services?
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi Ayush, thanks for taking the time to go through it.
In theory, you can have an HTTP service AND a microservice inside the same project, in NestJs there's a
main.ts
file that works as an entry point, that's where you usually start the app (whether it's an express HTTP server or a microservice), you can modify the main.ts file so it runs both.Now, my recommendation is to have 2 NestJs applications:
This way you can "send stuff" to your Microservice using an HTTP Service. Is there a practical reason you can't have the two services?