When developing a productive application further topics like finding and analysing issues become also important. For now these topics are only described high level to give an idea of the direction.
The application can be manually tested locally as long as no Event Mesh based integration has been added.
-
Edit the sandbox credentials in file
package.json
:"byd_khproject": { "kind": "odata-v2", "model": "srv/external/byd_khproject", "[sandbox]": { "credentials": { "url": "https://{{byd-hostname}}/sap/byd/odata/cust/v1/khproject/", "authentication": "BasicAuthentication", "username": "{{user}}", "password": "{{password}}" } } }, "byd_khproject_tech_user": { "kind": "odata-v2", "model": "srv/external/byd_khproject_tech_user", "[sandbox]": { "credentials": { "url": "https://{{byd-hostname}}/sap/byd/odata/cust/v1/khproject/", "authentication": "BasicAuthentication", "username": "{{user}}", "password": "{{password}}" } } },
-
Run command
cds watch
orcds watch profile --sandbox
on the command line interface. This will start a NodeJS-server including the web application.
After adding the event-based integration with ByD
-
Run command
cf env author-readings-srv
to get the environment properties. -
Add a new file
default-env.json
to the project root folder. -
Copy the sections referring to the properties
VCAP_SERVICES
andVCAP_APPLICATION
into the new file, enclose the two property names by double quotes, and embrace it all by curly brackets. In result the file content should look like{ "VCAP_SERVICES": { //content }, "VCAP_APPLICATION": { //content } }
-
Now you can test in BAS using the command
cds watch profile --production
.
You may consider adding log statements to the service implementations, such as for example
console.log("Author reading " + authorReadingIdentifier +" is blocked via event message");
console.log("Event message log updated");
console.log("Internal error on processing ByD event notifications: " + error);
In result you can review your own and others log messages using command cf logs author-readings-srv --recent
in the BAS terminal.
Local debugging can be done with the standard nodeJS debugging tools. See also CAP Debugging.