Test / README.md
Varsha Dewangan
readme file updated
54fc332
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

  1. Install dependencies:
pip install -r requirements.txt
  1. Run the application:
python app.py
  1. 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.