I have in netlify.toml
:
[[headers]] for = "/*" [headers.values] Access-Control-Allow-Origin = "*"
Can you try and make a local request to the mongo.ts
function on tik2.netlify.app like:
var coll='index'; export async function find(coll: string) { var res = await (await fetch('https://tik2.netlify.app/.netlify/functions/mongo?op=find&coll=' + coll)).json();console.log(1, res)}
Doing this from local does not work, I get:
errorType: 'SyntaxError', errorMessage: 'Unexpected end of JSON input',
I just deployed t–tik2.netlify.app and mongo here does not work if you look in the console.
I have an open issue.