tasso94 / nestjs-cambpm

Run your business logic anywhere.
Apache License 2.0
17 stars 4 forks source link

how to use ConfigService for baseUrl #3

Open alaamh opened 1 year ago

alaamh commented 1 year ago

How to read baseUrl from ConfigService?

  providers: [
    ExternalTaskConnector,
    ExternalTaskModule.createClient({
      baseUrl: 'http://localhost:8080/engine-rest',
    }),
  ],

I have tried as below but did not work:

  providers: [
    ExternalTaskConnector,
    {
      provide: 'CONNECTION_PROVIDER',
      inject: [ConfigService],
      useFactory: (configService: ConfigService) =>
        ExternalTaskModule.createClient({
          baseUrl: configService.get(
            'CAMUNDA_BASE_URL',
            'http://localhost:8080/engine-rest',
          ),
        }),
    },
  ],