Hi All,
I am doing a post call to the DMN decision with the decision values in json format but when doing the post call to my localhost:8080 where the camunda DMN decision is running i am facing CORS issue. Below is the code
var data = JSON.stringify(
{
"season":
{
"type": "string",
"value": "Spring"
},
"children":
{
"type": "boolean",
"value": true
},
"weather":
{
"type": "string",
"value": "Sunny"
},
"time":
{
"type": "string",
"value": "morning"
},
"interest":
{
"type": "string",
"value": "activity"
}
},
false, 2
);
$('.json .language-json .request').text(data);
$('.json').show();
$.ajax
({
type: 'POST',
url: apiUrl + 'decision-definition/example-berlin:1:4adc11a5-3c2a-11e9-942f-0242977e95b7',
data: data,
dataType: 'json',
contentType: 'application/json; charset=utf-8',
success: function (data) {
$('.json .language-json .response').text(JSON.stringify(data, null, 2));
$('#recommendationsContainer').show();
if (data.rules.length > 0) {
$.each(data.rules, function (key, value) {
$('#recommendations').append(''
+ '' + value.outputs.recommendation.value + ''
+ 'More Info');
});
} else {
$('#recommendations').append(''
+ 'Sorry, no ideas for this combination :-(');
}
}
});
This the
apiUrl = “http://localhost:8080/camunda/app/cockpit/default/”
which i am hitting and facing the CORS issue but i hit the below URL
apiUrl = “https://dmn.lab.camunda.com/api/v1/”
i am not facing any issues. Can someone point me what i doing wrong here.
Thanks in advance