Add status ping route to your Flask Server
Project description
Flask-Status
The Flask Status Extension is a simple Flask extension that adds a status ping route to your Flask application. It allows you to easily check the health and status of your application or services by accessing a designated endpoint.
Features
- Status Endpoint: Adds a
/api/status
endpoint to your Flask application. - Custom Status Message(coming soon): Set a custom status message to provide more specific information about the health of your application.
- Logging(coming soon): Logs incoming requests to the status endpoint and changes to the custom status message for monitoring purposes.
Installation
To install the Flask Status Extension, you can use pip
:
pip install flask-status
Usage
Here's how to use the Flask-Status extension in your Flask application
-
Install the package using pip
-
create a file
main.py
-
Add the following to
main.py
from flask import Flask
from flask_status import FlaskStatus
app = Flask(__name__)
FlaskStatus(app, url="/api/status")
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000)
- run the
main.py
file
python3 main.py
-
Now go to http://localhost:5000/api/status
-
You should see the following
{
"status": "OK"
}
Issues
If you encounter any issues with this extension or have suggestions for improvements, please create an issue on the GitHub Issues page.
You are also welcome to contributing to this project.
Special thanks to the Flask community
Author
- Emmanuel Nwafor
- GitHub
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for Flask_Status-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ebad0b9d056e1ef27409edb97ae486929cf82f523917788f2ce04d2bb30ce75b |
|
MD5 | 6950f7d9724ed442f53f6cbe2b41e41e |
|
BLAKE2b-256 | 9fb9e7cb0f5fbaf2e958ad6ec894e5c39c30d4006b893e0e6e6373bb2b28b849 |