docs
docs copied to clipboard
OData Absolute Context URL is not working
I tried to configure an Absolute Context URL with the variable cds.odata.contextAbsoluteUrl for the @odata.context property as it is written in the documentation:
- https://cap.cloud.sap/docs/advanced/odata#absolute-context-url
But it has no effect. Then I have searched in the node module for the use of this variable @sap/cds, but it seems that this variable don't exists.
Content of package.json:
{
"name": "ODataAbsoluteUrl",
"version": "1.0.0",
"description": "A simple CAP project.",
"repository": "<Add your repository here>",
"license": "UNLICENSED",
"private": true,
"dependencies": {
"@sap/cds": "^7",
"express": "^4",
"@sap/cds-hana": "^2"
},
"devDependencies": {
"@cap-js/sqlite": "^1",
"@sap/eslint-plugin-cds": "^3",
"eslint": "^9"
},
"scripts": {
"start": "cds-serve"
},
"cds": {
"requires": {
"db": "hana"
}
}
}
Code for server.js:
const cds = require('@sap/cds')
cds.odata.contextAbsoluteUrl = "https://your.domain.com/yourService"