Getting Error 404/Route not allowed when calling external endpoint from custom app in dev mode

const options = {
headers: {
“Authorization”: "token " + “XXXX:XXXX”,
“Content-Type”: “application/json”,
“Accept”: “application/json”
},
body: JSON.stringify(payload),
isOAuth: false
};
console.log(“Making request to:”, url);
console.log(“With headers:”, options.headers);
const response = await clientInstance.request.post(url, options);
console.log(“Frappe API response:”, response);
// Parse response
let responseData = response;
if (typeof response === “string”) {
try {
responseData = JSON.parse(response);
} catch (e) {
console.warn(“Could not parse response as JSON”);
}
}
Console Output:
vendor-4676a9e788102…f473c64d61f0.js:468
POST http://localhost:10001/dprouter?product=freshchat 404 (Not Found)
send @ vendor-4676a9e788102…f473c64d61f0.js:468
ajax @ vendor-4676a9e788102…f473c64d61f0.js:444
(anonymous) @ fc_agent_app-c39a559…18bee5c7bc.js:13138
(anonymous) @ vendor-4676a9e788102…473c64d61f0.js:3690
x @ vendor-4676a9e788102…473c64d61f0.js:3690
ajax @ fc_agent_app-c39a559…18bee5c7bc.js:13138
value @ fresh_parent.js?=4066591385:21
value @ fresh_parent.js?
=4066591385:21
value @ fresh_parent.js?=4066591385:21
value @ fresh_parent.js?
=4066591385:11
channel.port1.onmessage @ fresh_parent.js?_=4066591385:11
app.js:2621 Ticket creation failed:
{message: ‘Route not allowed’, status: 404}
createFrappeTicket @ app.js:2621
await in createFrappeTicket
handleFormSubmit @ app.js:2516