Spaces:
Sleeping
Sleeping
| title: Test File | |
| emoji: π₯ | |
| colorFrom: purple | |
| colorTo: yellow | |
| sdk: docker | |
| pinned: false | |
| # Flask Test App for Hugging Face Spaces | |
| A simple Flask web application designed for testing deployment on Hugging Face Spaces. | |
| ## Features | |
| - Simple web interface with greeting functionality | |
| - REST API endpoint for testing | |
| - Health check endpoint | |
| - Responsive design | |
| - Ready for Hugging Face Spaces deployment | |
| ## Project Structure | |
| ``` | |
| flask-test-app/ | |
| βββ app.py # Main Flask application | |
| βββ requirements.txt # Python dependencies | |
| βββ Dockerfile # Docker configuration | |
| βββ README.md # This file | |
| βββ templates/ | |
| βββ index.html # HTML template | |
| ``` | |
| ## Local Development | |
| 1. Install dependencies: | |
| ```bash | |
| pip install -r requirements.txt | |
| ``` | |
| 2. Run the application: | |
| ```bash | |
| python app.py | |
| ``` | |
| 3. Open your browser and navigate to `http://localhost:7860` | |
| ## API Endpoints | |
| - `GET /` - Main web interface | |
| - `POST /api/greet` - Greeting API endpoint | |
| - `GET /health` - Health check endpoint | |
| ## Deployment on Hugging Face Spaces | |
| 1. Create a new Space on Hugging Face | |
| 2. Choose "Docker" as the SDK | |
| 3. Upload all the files from this project | |
| 4. The app will automatically deploy and be accessible via your Space URL | |
| ## Testing the Deployment | |
| Once deployed, you can test the application by: | |
| 1. Visiting the main page to see the web interface | |
| 2. Using the greeting form to test the API | |
| 3. Checking the health endpoint at `/health` | |
| The application runs on port 7860, which is the default port for Hugging Face Spaces. |