This project is a basic application that uses Flask to serve an HTML file via a REST API. To understand the fundamentals of a REST server with Python and Flask.
- Backend: Python, Flask
- Server: Flask Development Server
- Frontend: Static HTML
Before running this project, make sure you have the following components installed:
- Python 3.10 or later
- Git
- A text editor such as Visual Studio Code (optional).
Use the following command to clone the project from GitHub:
git clone https://github.com/ciizao/RestAPI_Python.git
Create a virtual environment to manage the project dependencies:
cd RestAPI_Python
Create a virtual environment to manage the project dependencies:
python -m venv venv
- On Windows
venv\Scripts\activate
- On MAC/Linux
source venv/bin/activate
Use the requirements.txt file to install the necessary dependencies:
pip install -r requirements.txt
Start the Flask server with the following command:
python app.py
Open your browser and go to the URL:
http://localhost:1000/api/hello
- You should see the content of the helloRestAPI.html file.
- The source code for this project is available on GitHub:
https://github.com/ciizao/RestAPI_Python.git
