Error while calling fastai trained cnn model from javascript

below : Javascript client.jst xhr post ,send and onload peice using analyze end point“POST”, ${loc.protocol}//${loc.hostname}:${loc.port}/analyze,true)

xhr.onload = function() {
if (this.readyState === 4) {
var response = JSON.parse(xhr.responseText);
el(“result-label”).innerHTML = Result = ${response["result"]};
el(“analyze-button”).innerHTML = “Analyze”;

var fileData = new FormData();
fileData.append(“file”, el(“file-input”).files);

below : HTML Index.htmlcode peice

below : getting error at xhr.send(fileData) when i inspect on chrome browser
getting syntax error at parse , failed to load resource and method not allowed.

(index):1 Uncaught SyntaxError:
Unexpected token I in JSON at position 0
at JSON.parse ()

at XMLHttpRequest.xhr.onload (client.js:34)

failed to load resource responded with status of 404()

Method Not Allowed