Flutter – Getting ClientException: XMLHttpRequest error while trying to call OpenAI API in backend
Here's server.js: const express = require("express"); const cors = require("cors"); const axios = require("axios"); const app = express(); app.use(cors()); app.use(express.json()); app.post("/", async (req, res) => { try { const apiKey = "sk-xxxxxxxxxxxxxxxxxxxxx"; const prompt = req.body.prompt; // You would need…