Skip to content

Word Cloud widget fails to load due to missing route in Express gateway #175

Description

@vedant-kawale-27

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" });
}
});

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions