Can I call routes in a RESTApp from a Script or a WebApp?
Yes, RestAppInvokerFactory is the starting point to make calls to a RESTApp without any outgoing requests.
RespAppInvokerFactory make it possible to make call routes in a WebbApp from a Script module.
Step 1 - Get an instance of RestAppInvokerFactory
For WebApp/RESTApp - use import:
For Script module - use require: