Title: Express gateway returns 404 for /api/wordcloud
Description: The React frontend (WordCloud.jsx) fetches spam word count data from /api/wordcloud. Vite proxies this to the Express backend (port 3000), but backend/server.js does not have a route defined for it, even though the Flask ML API implements it on port 5000.
Steps to Reproduce:
Start the frontend and backend servers.
Inspect the network tab; requests to /api/wordcloud fail with a 404 Not Found error.
Proposed Fix: Add a proxying endpoint in
backend/server.js
:
javascript
app.get("/api/wordcloud", async (req, res) => {
try {
const response = await axios.get(${ML_API_BASE}/api/wordcloud);
res.json(response.data);
} catch (error) {
res.status(500).json({ error: "Failed to forward wordcloud request" });
}
});
Title: Express gateway returns 404 for /api/wordcloud
Description: The React frontend (WordCloud.jsx) fetches spam word count data from /api/wordcloud. Vite proxies this to the Express backend (port 3000), but backend/server.js does not have a route defined for it, even though the Flask ML API implements it on port 5000.
Steps to Reproduce:
Start the frontend and backend servers.
Inspect the network tab; requests to /api/wordcloud fail with a 404 Not Found error.
Proposed Fix: Add a proxying endpoint in
backend/server.js
:
javascript
app.get("/api/wordcloud", async (req, res) => {
try {
const response = await axios.get(
${ML_API_BASE}/api/wordcloud);res.json(response.data);
} catch (error) {
res.status(500).json({ error: "Failed to forward wordcloud request" });
}
});