-
-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Config not propagating to Consul ? #20
Comments
It should be using 192.168.1.20 ip from the config.yaml |
The other thing, I am not sure if its correct but on the forRootAsync, the only thing it accepts is a AsyncConsulOptions
which only contains "inject", it doesn't contain anything else or inherit from ConsulOptions. |
The discoveryHost is your service address, not consul address. This is an config example: consul:
host: 192.168.1.20
port: 8500
service:
discoveryHost: 127.0.0.1
healthCheck:
timeout: 1s
interval: 10s
maxRetry: 5
retryInterval: 5000
id: null
name: nestcloud-starter-service
port: 8081 |
Ah damb :-) Thank you. My bad. |
@miaowing Could i draw your attention to this ? In the Service module - there is a forRoot and forRootAsync
I would like to override the discoveryHost, the normal pattern of nestjs forRootAsync is that it takes a method, usually called "useFactory" - where you can inject things and get access to them i.e.
Not sure what I can do here ? I need to inject my own Class and don't want to depend on the BOOT Also in the Consule though there is this
The forRootAsync only takes in a "inject" nothing else, so I am not able to override anything. Is this right ? YOu should be able to override it right ? |
It's not support |
Ok - thanks |
You can also use the boot module instead of v0.6.x: import { NEST_BOOT_PROVIDER, IBoot } from '@nestcloud/common';
MongooseModule.forRootAsync({
inject: [NEST_BOOT_PROVIDER],
useFactory: async (boot: IBoot) => ({
uri: boot.get<string>('MONGODB_URI'),
}),
}); v0.7.x: import { BOOT, IBoot } from '@nestcloud/common';
MongooseModule.forRootAsync({
inject: [BOOT],
useFactory: async (boot: IBoot) => ({
uri: boot.get<string>('MONGODB_URI'),
}),
}); |
Hi,
I managed to get it bootstraping now, but I have a problem that it's trying to connect to 127.0.0.1 for consul but i have the BootModule loaded with my config.yaml.
It is supposed to pick this up right?
Hey is there a slack or discord service for nestcloud - just for future reference?
Here is a capture of the screen
The text was updated successfully, but these errors were encountered: