Ignition WebDev + Flask API Chatbot Integration Issues (CORS, Network, Connection Errors)

I am integrating Ignition WebDev (HTML/JS) with a Python Flask API chatbot using OpenAI LLM.

Architecture:

Ignition WebDev UI → Flask API (/chat) → OpenAI API → response

:gear: Backend
Flask running on 0.0.0.0:5000
Endpoint: POST /chat
Flask-CORS enabled
Returns JSON response from OpenAI API

:globe_with_meridians: Frontend (Ignition WebDev)
fetch("http://10.11.12.84:5000/chat", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
message: msg
})
})

:red_exclamation_mark: Issue Summary

  1. Only OPTIONS requests appear

Flask logs show:

OPTIONS /chat 200

No POST request is reaching the backend.

  1. Frontend connection error

Frontend returns:

{
"error": "Connection error.",
"success": false
}
3. Method Not Allowed on browser test

Opening /chat in browser returns:

Method Not Allowed
4. CORS / preflight issue suspected

Even with flask_cors.CORS(app) enabled, POST request is not executed.

  1. Network / firewall uncertainty

Tried multiple URLs:

127.0.0.1:5000
myipxxx:5000

But Ignition WebDev cannot reliably reach Flask API.

:red_question_mark: Need help with:
Correct Ignition WebDev → Flask integration approach
Handling CORS + OPTIONS preflight properly
Required network/firewall configuration for LAN communication
Recommended architecture for Ignition + external Python API