Well, I followed OLGA’s advice, look out all the httpProtocol sections, and only did the add to
and it works. My issue was the await for the fetch for the javascript. This is method is now working for me (see below).
my only remaining question is that I tried:
To add a little bit of CORS protection, but that does not work. So far only “*” works. Any suggestions?
Here is my working fetcher for next job number.
const fetchJobNum = (async () => {
const url = 'https://epicorapp2.draper.com/ERP10.1Test/api/v1/Erp.BO.JobEntrySvc/GetNextJobNum'
const reply = await fetch(url, {
method: 'POST',
mode: 'cors',
headers: {
'Accept': 'application/json',
'Authorization': 'Basic <no, I don't show you clearText password',
'Access-Control-Allow-Origin': '*',
'Content-Type': 'application/json'
},
body: JSON.stringify({})
})
let rsp = await reply.json()
let job = rsp.parameters.opNextJobNum
return job
})