|
--- |
|
title: Flask Web App |
|
emoji: π |
|
colorFrom: blue |
|
colorTo: green |
|
sdk: docker |
|
app_port: 7860 |
|
pinned: false |
|
--- |
|
|
|
# Flask Web Application for Hugging Face Spaces |
|
|
|
This is a simple Flask web application deployed on Hugging Face Spaces. It provides: |
|
|
|
- A clean web interface showing the current server time |
|
- A REST API with endpoints for getting the current time and echoing data |
|
- Cross-origin resource sharing (CORS) support for API access from other domains |
|
|
|
## API Endpoints |
|
|
|
- `/api/time` - GET request that returns the current server time |
|
- `/api/echo` - POST request that echoes back any JSON data sent to it |
|
|
|
## Local Development |
|
|
|
To run this application locally: |
|
|
|
1. Install the required dependencies: |
|
``` |
|
pip install -r requirements.txt |
|
``` |
|
|
|
2. Run the Flask application: |
|
``` |
|
python app.py |
|
``` |
|
|
|
3. Open your browser and navigate to `http://localhost:7860` |
|
|
|
## Deployment |
|
|
|
This application is configured for deployment on Hugging Face Spaces using Docker. |
|
|