import {inject} from '@loopback/core'; import {juggler} from '@loopback/repository'; import config from './check-in-users-service.datasource.json'; // Observe application's life cycle to disconnect the datasource when // application is stopped. This allows the application to be shut down // gracefully. The `stop()` method is inherited from `juggler.DataSource`. // Learn more at https://loopback.io/doc/en/lb4/Life-cycle.html export class CheckInUsersServiceDataSource extends juggler.DataSource { static dataSourceName = 'CheckInUsersService'; static readonly defaultConfig = config; constructor( @inject('datasources.config.CheckInUsersService', {optional: true}) dsConfig: object = config, ) { Object.assign(dsConfig, { options: {baseUrl: process.env.USER_SERVICE_URL}, }); super(dsConfig); } }