Closed emilianosantucci closed 6 years ago
I'd be happy to answer your questions.
app.get('/hello', function(req,res) {})
, you can use this style:@Get()
@Path('/hello')
sayHello(@Request() req, @Response() res) {
// whatever you want
}
I hope this helps!
Thank you @wbhob for your help. Maybe talk about my app can explain more what I need.
I'm starting develop an application with Moleculer and my code now is only for a PoC purpose. This framework has ability to service auto-discovery, REPL integration and more features for the microservice "world" like a charm. But (there is ever a "but"), talking about how build a microservice, don't have the flexibility as Nest to write clean and re-usable code.
My purpose is to combine this frameworks to take advantage from both: Nest to build a great microservices and Moleculer for manage them.
During my study about do that, I've found only one formula, but I hope there are other:
Personally, I don't like this idea of architecture, too much "jumps" to reach the goal, with many communication errors prone. So my goal is to handle the Nest application, if possible, inside Moleculer microservice without client/server communication (like a service, for intends).
Would you think about? Any suggestions?
Nest microservices aren't actually the modern definition of "microservices", as indicated in the docs. However, I see an opportunity for a module here! I'm talking to the project creator about joining the core team and I think that would be a good place to start!
Hi @emilianosantucci, As far as I understand you wanna access the modules/components from outside the Nest application zone/context - just do not use any transport layer but take advantages from the modularity / DI things. Am I right?
Exactly @kamilmysliwiec. in Moleculer is possible to attach an external third-part microservice but you need to respect some convention (like a health states, actions, ...). I'm also an Angular.io and Java developer and I think that Nest have a great IoC, DI (like Spring for Java) and module system not just for using on web application. Is a great opportunity to take this advantage out-of-box because there is no other frameworks do that in NodeJS (TypeDI cover only the DI with TypeScript).
Hi @emilianosantucci,
I'm strongly thinking about a right solution. What is your opinion about this proposal - add a method which responsibility is to create an application but instead of attaching http server / microservice, it'd only return the RootModule
instance so you can get()
any component which belongs to its?
It seems to be the right approach, especially if anyone can get(...)
a component / module without take care about right DI onto outside context.
In this case anyone will be able to create an eco-system of modules and use them where we need, also as npm dependency.
I've only a consideration to do (just for implement it with enterprise vision): if I request the RootModule
into two separate slice of code inside the same application, what obtain? Two separate contexts or just a shared context?
I think that "shared context" is the right one but I consider the (possible) trouble to do that. One solution is to move that issue on outside context, taking care to create a shared class as a component factory.
Hi @kamilmysliwiec, any news about that?
Can I help for something?
In progress π€
This feature is waiting for the next release. Hope you'll enjoy π
I embrance it where is avaiable and give you feedback in case. Thanks for your work. Can I close this issue or prefer to take it open until feature released?
Let's keep it opened for now π
4.4.0
is published now!
Hi. Iβm interested in this too. Any example of its usage now that itβs been published? @kamilmysliwiec
@emilianosantucci Did you manage to get this working? Would you mind provided an example?
@Zeldaze not yet, but you can find its usage on project changelog. I think @kamilmysliwiec provide an example on official documentation in the next weeks, if I can't make it before.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Hi all, I want use this gorgeous framework inside my application but I've some questions to ask: