I’m running a small testing thing on glitch, using Express it will send me a JSON response along the lines of:
{"resp":930}
And i’m getting HTML (The loading screen on myactive project)
How the heck do I fix this! My local JS errors on the json.parse(response) because of the stupid HTML!
(It’s using a POST request, not a GET request and my project is online and works for me when I use my browser to GET it.)
@thetayloredman I can’t really tell, but I suspect you’re using res.render (serves html/templater file) instead of res.send. Can you share a link to your Glitch project and any errors that show up in the console/DevTools?
Unfortunately you might need to add code to detect the glitch loading screen and retry requests, you can use the Content-Type header to check for white type of data is sent
Anyway, it was said a long time ago that setting Content-Type on the request would help. I never tried this, because it seemed too weird. Maybe give that a shot