cancel
Showing results for 
Search instead for 
Did you mean: 

Odata service version in CAPM

I533303
Advisor
Advisor
0 Kudos

Hi ,

How to control OData service version generated using SAP Cloud Application Programming Model ?

Thank you ,

Accepted Solutions (1)

Accepted Solutions (1)

vansyckel
Employee
Employee

Hi idman,

In Node.js, you can add a v2 proxy (cf. https://developers.sap.com/tutorials/cap-cloudsdk-2-v2-adapter.html).

Best,
Sebastian

I533303
Advisor
Advisor
0 Kudos

Hello vansyckel,

Thank you for your answer, please how can I add v2 proxy to my CAPM project and where ?

Should I create a file server.js like it is showing in this tutorial https://developers.sap.com/tutorials/cap-cloudsdk-2-v2-adapter.html ,

Regards,

Mariam

vansyckel
Employee
Employee

Hi idman,

Yes, either that or you can also use our newer bootstrapping features as described in https://cap.cloud.sap/docs/releases/feb20#support-for-local-serverjs and would result in something like below.

Best,
Sebastian

// local ./server.js
const cds = require('@sap/cds')
const odatav2proxy = require('@sap/cds-odata-v2-adapter-proxy')

let app

cds.on('bootstrap', a => {
  app = a
})

cds.on('serving', () => { // > invoked before app.listen
  app.use(odatav2proxy({ port: <port> }))
})

module.exports = cds.server // > delegate to default server.js

Answers (1)

Answers (1)

I533303
Advisor
Advisor
0 Kudos

Thank you vansyckel it works !