-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Integration of services with controllers (technical preview) #1267
Comments
@raymondfeng Could you update the acceptance criteria for estimation? Thanks |
@shimks Updated |
Is the Service assumed to be created using LB3 constructs? (strong-remoting / strong-soap)? |
Looking at the PR we have for the weakly typed service integration spike, we already have the
Yeah I think so (see https://github.com/strongloop/loopback-next/pull/1119/files#diff-acfd88705f55f0e2f6831937a276b7fbR19). |
The PR is feature complete and ready for review. |
Cross-posting from #1069 (comment): IMO, the pull request #1119 is only a part of the overall story. While it makes it easy to consume services in controllers, it omits other important use cases. 1] When consuming a service using REST connector with template-based configuration: As an app developer, I would definitely want to have few smoke tests to verify that my templates work as intended and match the API provided by the service at the other side. I would like to write an integration test that's using only the service (not the full app!), something along the following lines: import {GeoService} from '../services/geo.service';
import {expect} from '@loopback/testlab';
describe('GeoService', () => {
let service: GeoService;
beforeEach(() => service = new GeoService());
describe('geocode', () => {
it('returns geo coords for a given address', () => {
const result = await service.geocode('107 S B St', 'San Mateo', '94401');
// { lat: 37.5669986, lng: -122.3237495 }
expect(result.lat).approximately(37.5669986, 0.5);
expect(result.lng).approximately(-122.3237495, 0.5);
});
});
}); 2] There should be also a new CLI command for creating services, this command should:
|
@bajtos Although I agree that what you're proposing should be done as an outcome of the spike, IMO this is out of scope for what we have estimated and I feel that it should live in its own issue to be estimated and groomed. |
PR: #1119 |
@shimks you are right, I agree scope creep is bad. At the same time, I don't want us to release a half-baked feature that's difficult to use. I am going to:
|
@raymondfeng Is the (technical preview) feature complete? If so, can you close it please? |
Closing as done. |
Description
Explore how service integration works with controllers. This task is an outcome of #1069.
Use case
A controller needs to invoke a REST API or SOAP web service.
Or
We'll configure two datasources and bind them to the context.
Acceptance Criteria
@serviceProxy
decorator for constructor parameters or properties to inject a service proxy for backend servicesThe text was updated successfully, but these errors were encountered: