AOSSIE-Org / AOSSIE-Org/EduAid

PDF Upload Fails - API URL undefined and unexpected token error

オープン
#241 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
171
フォーク
425
PR マージ指標
30日以内にマージされた PR はありません

説明

#Issue summary

When trying to upload a PDF file, the request is sent to `undefined/upload`, resulting in a `404 Not Found` error

#Steps to Reproduce
1. Run the EduAid backend (`flask run`) and frontend (`npm start`).
2. Open the frontend on `localhost:3000`.
3. Try uploading a PDF file.
4. See the errors in the browser console.

#Expected Behavior
The PDF should be successfully uploaded, and the API should return a proper JSON response.

#Actual Behavior
- `POST http://localhost:3000/undefined/upload 404 (Not Found)`
- `SyntaxError: Unexpected token '<'` (Not valid JSON response)

#

![Image](https://github.com/user-attachments/assets/fc8e07ba-2bd1-4926-933b-29171c89db3c)

Possible Fix
- Ensure that the frontend correctly references the backend API (`http://localhost:5000/upload`).
- Add an `/upload` route in the Flask server if missing.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。