Like the previous exercises, you will start by creating a new module.
Name the module
js and press Next.
Be sure to check the box Enable XSJS support. Then press Next. Then press Finish.
Once again the
mta.yaml file has been extended to add the
Now you need to add the dependency from the web module to this new Node.js module and a destination route to it as well.
Requires section, add a
js-api (this should match the name of the value under
Provides in the new
js module) module with group
destinations. Add the following key-value pairs as the properties for the
The complete section for the web module should now look like this:
You also need to extend the new
js module that was just created. It will need a dependency to both the
hdi resource. You also need to make sure the module is exposed for use in the destination route.
requires in the
js service, add the
uaa service, the HDI container and db module:
The complete section for the
js module should now look like this:
Hint: Take a look at the Code Editor tab at the bottom. You will see the actual contents of the
MTA.yaml file. This file is very sensitive to spaces and indentation, so the MTA Editor simplifies edition.
Later at deploy, the destination routing builds a dependency and navigation ability between the two services without ever having to hard code the URLs or ports. They are assigned at deploy time and all references are automatically updated.
If you remember back, you maintained the
xs-app.json of the App Router web module. Now you can add rules for redirecting certain requests to the web module into other modules in this project.
This is where you are configuring that any file request with the extension
.xsodata should be rerouted internally to the Node.js destination that you defined in the