@sap/ux-ui5-tooling 1.8.1 → 1.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -283,6 +283,34 @@ server:
283
283
  src: "Path/To/libs"
284
284
  ```
285
285
 
286
+ #### [Example configuration for mocking the User API Service from @sap/approuter](#example-configuration-for-mocking-the-user-api-service-from-sapapprouter)
287
+ If you are using the [User API Service](https://www.npmjs.com/package/@sap/approuter#user-api-service) from `@sap/approuter` in your application, then you can mock by providing the following configuration.
288
+
289
+ ```
290
+ server:
291
+ customMiddleware:
292
+ - name: fiori-tools-servestatic
293
+ afterMiddleware: compression
294
+ configuration:
295
+ paths:
296
+ - path: /userapi/currentUser
297
+ src: "Path/To/UserJson"
298
+ index: "user.json"
299
+ fallthrough: false
300
+ ```
301
+ whereas the `user.json` can look like this e.g.
302
+
303
+ ```
304
+ {
305
+ "firstname": "John",
306
+ "lastname": "Doe",
307
+ "email": "john.doe@example.com",
308
+ "name": "john.doe@example.com",
309
+ "displayName": "John Doe (john.doe@example.com)",
310
+ "scopes": "openid,user_attributes,uaa.user"
311
+ }
312
+ ```
313
+
286
314
  ### [Configuration options](#configuration-options-1)
287
315
  Additionaly you can specify any of the configuration options (excluding `setHeaders`!) of the [serve-static](https://www.npmjs.com/package/serve-static) middleware.
288
316