Spaces:
Sleeping
Sleeping
metadata
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
- Install dependencies:
pip install -r requirements.txt
- Run the application:
python app.py
- Open your browser and navigate to
http://localhost:7860
API Endpoints
GET /- Main web interfacePOST /api/greet- Greeting API endpointGET /health- Health check endpoint
Deployment on Hugging Face Spaces
- Create a new Space on Hugging Face
- Choose "Docker" as the SDK
- Upload all the files from this project
- The app will automatically deploy and be accessible via your Space URL
Testing the Deployment
Once deployed, you can test the application by:
- Visiting the main page to see the web interface
- Using the greeting form to test the API
- Checking the health endpoint at
/health
The application runs on port 7860, which is the default port for Hugging Face Spaces.