4.8.1 • Published 6 months ago
@amag-ch/cds-remote v4.8.1
Wrapper for communication with external http services
Table of Contents
Installing
Using npm:
$ npm install @amag-ch/cds-remote
Using yarn:
$ yarn add @amag-ch/cds-remote
Configuration
Simple configuration over cds requires
{
"cds": {
"requires": {
"remote-service": {
"kind": "odata-v4",
"credentials": {
"destination": "remote-service-destination"
}
}
}
}
}
Read configuration in implementation
const remoteService = await cds.connect.to('remote-service')
const baseUrl = await remoteService.getBaseUrl()
const configuration = await remoteService.getConfiguration()
Implementation
const remoteService = await cds.connect.to('remote-service')
const response = await remoteService.get('/Ressource')