UNPKG

@central-credit/app

Version:

Application Central Credit

34 lines (27 loc) 959 B
// Copyright IBM Corp. 2018. All Rights Reserved. // Node module: loopback4-example-shopping // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT import { inject, lifeCycleObserver, ValueOrPromise } from '@loopback/core' import { juggler, AnyObject } from '@loopback/repository' import debugFactory from 'debug' import { NAMESPACES } from '../debug-config.js' import config from './mongo.datasource.config.json' const debug = debugFactory(NAMESPACES.MONGO) @lifeCycleObserver('datasource') export class MongoDataSource extends juggler.DataSource { static dataSourceName = 'mongo' constructor( @inject('datasources.config.mongo', { optional: true }) dsConfig: AnyObject = config ) { super(dsConfig) } start(): ValueOrPromise<void> { debug('Starting DataSource') } stop(): ValueOrPromise<void> { debug('Stopping DataSource') return super.disconnect() } }