Fix #133: Add root route to fix 404 error on backend root URL#188
Open
hkc5 wants to merge 2 commits into666ghj:mainfrom
Open
Fix #133: Add root route to fix 404 error on backend root URL#188hkc5 wants to merge 2 commits into666ghj:mainfrom
hkc5 wants to merge 2 commits into666ghj:mainfrom
Conversation
- Added a root route '/' that returns service info and available endpoints - Fixes issue 666ghj#133 where accessing 0.0.0.0:5001/ returned 404 - The root endpoint now provides helpful information about available API endpoints
Author
|
This PR fixes the 404 error when accessing the backend root URL (0.0.0.0:5001). The issue was that Flask only had routes for /health and /api/*, causing confusion for users who expected to see something when accessing the backend directly. Added a simple root route that returns service info and available endpoints. Ready for review when you have time! Thanks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When accessing the backend at
0.0.0.0:5001, users receive a 404 error. This is confusing because the server appears to start successfully but the root URL returns nothing.Solution
Added a root route (
/) that returns:Changes
backend/app/__init__.pyto add an@app.route('/')endpointTesting
The root endpoint now returns:
{ "service": "MiroFish Backend", "status": "running", "version": "1.0.0", "endpoints": { "health": "/health", "api": { "graph": "/api/graph", "simulation": "/api/simulation", "report": "/api/report" } } }Fixes #133