Skip to Content
0
Jun 03, 2022 at 01:59 PM

Fetch Logged in user details using managed approuter

275 Views Last edit Jun 03, 2022 at 02:50 PM 3 rev

need immediate attention.

Facing issue calling user-api of approuter, getting 404 resource not found error

Followed below steps in sequence

1. I Have created a basic MTA project in BAS.

2. Then added a managed approuter into the application via MTA file Create MTA module from template.

3. after that added a fiori module into my basic MTA project from MTA file Create MTA module from template.

4. npm i @sap/approuter ran at the root terminal of Basic MTA project.

5. added below snipet into xs-app.json file of fiori module

{

"source": "^/user-api(.*)",

"target": "$1",

"service": "sap-approuter-userapi"

}

6. added below line into package.json of my root Basic MTA project

"scripts": {

"start": "node node_modules/@sap/approuter/approuter.js",

7. called user api from my controller

$.ajax({

method: "GET",

url: "/user-api/currentUser",

async: true,

like wise

unfortunately the call is going in error call back.

Please help me with your input.

Regards,

Ranjeet