nest icon indicating copy to clipboard operation
nest copied to clipboard

2 differents aplications with the same main

Open menme95 opened this issue 8 years ago • 5 comments

I'm submitting a...


[X] Regression
[ ] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

I have 2 aplication running with the same main in two different ports. When I inicializate one of them, they are getting the controller/services of the second app.

The map when you start the modules looks fine although swagger schema is not correct.

Expected behavior

Each application should work with their own module.

Minimal reproduction of the problem with instructions

image image image image image

When you debug, the admin module go inside dashboard classes, and gui module have not instanciate yet.

What is the motivation / use case for changing the behavior?

We have dockers in k8s, a node app uses too much ram and that services are too small and it's not worth starting a pod for a single service and want to run both.

Environment


[System Information]
OS Version     : Windows 7
NodeJS Version : v10.0.0
NPM Version    : 6.0.0
[Nest Information]
microservices version : 5.0.0-beta.6
websockets version    : 5.0.0-beta.6
swagger version       : 2.0.0
testing version       : 5.0.0-beta.6
common version        : 5.0.0-beta.6
core version          : 5.0.0-beta.6
                                    

menme95 avatar May 15 '18 12:05 menme95

where is your Database Module?

whtiehack avatar May 16 '18 02:05 whtiehack

I've been looking for the bug, and the error hasn't been with the new version. I have three modules, generic where I have database module, admin module and gui module, the problem is when I import generic in both.

menme95 avatar May 16 '18 07:05 menme95

Could you show us GenericModule?

kamilmysliwiec avatar May 16 '18 11:05 kamilmysliwiec

Of course,


import { Module } from '@nestjs/common';

import { Config } from './config/config';
import { MailGeneric } from './classes/mail.class';
import { PayloadJWT } from './classes/payload.class';

//import { AuthModule } from './security/auth.module';
import { DatabaseModule } from './database/database.module';

@Module({
	imports: [Config, DatabaseModule, MailGeneric, PayloadJWT],
	controllers: [],
	providers: [Config],
	exports: [Config, DatabaseModule, MailGeneric, PayloadJWT]
})
export class GenericModule { }

Although I've already change my architectura and I work with your mongoose module again and I want to change Config to a custom provicer, I want to have here de AuthModule and export it to other classes.

menme95 avatar May 16 '18 15:05 menme95

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.

lock[bot] avatar Sep 24 '19 20:09 lock[bot]