-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup! preserve backwards compat for
lb4 service
Signed-off-by: Miroslav Bajtoš <[email protected]>
- Loading branch information
Showing
3 changed files
with
80 additions
and
36 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
packages/cli/snapshots/integration/generators/remote-service.integration.snapshots.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// IMPORTANT | ||
// This snapshot file is auto-generated, but designed for humans. | ||
// It should be checked into source control and tracked carefully. | ||
// Re-generate by setting UPDATE_SNAPSHOTS=1 and running tests. | ||
// Make sure to inspect the changes in the snapshots below. | ||
// Do not ignore changes! | ||
|
||
'use strict'; | ||
|
||
exports[`lb4 service (remote) legacy JSON-based configuration loads config from \`{name}.datasource.config.json\` 1`] = ` | ||
import {getService} from '@loopback/service-proxy'; | ||
import {inject, Provider} from '@loopback/core'; | ||
import {LegacyDataSource} from '../datasources'; | ||
export interface MyService { | ||
// this is where you define the Node.js methods that will be | ||
// mapped to REST/SOAP/gRPC operations as stated in the datasource | ||
// json file. | ||
} | ||
export class MyServiceProvider implements Provider<MyService> { | ||
constructor( | ||
// legacy must match the name property in the datasource json file | ||
@inject('datasources.legacy') | ||
protected dataSource: LegacyDataSource = new LegacyDataSource(), | ||
) {} | ||
value(): Promise<MyService> { | ||
return getService(this.dataSource); | ||
} | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters