.. | ||
index.html | ||
README.md | ||
script.js |
Static2API Frontend
This is a simple frontend that displays data from the Static2API application. It's designed to work with the API without requiring any changes to the container or backend.
Usage
-
Start the Static2API application either directly or via container:
python main.py
or
./run_container.sh
-
Open the
index.html
file in your browser:- You can use any static file server
- Or simply open the file directly in your browser
-
The frontend will fetch data from the following endpoints:
/
- Root endpoint/api/users
- Users data/api/contacts
- Contacts data
CORS Support
The FastAPI application has been updated with CORS middleware to allow cross-origin requests from this frontend. This means you can:
- Open the HTML file directly in your browser
- Access the API endpoints without CORS restrictions
- Serve the frontend from any static file server
No additional configuration is needed for CORS support.