Simple service to display a status image for space API endpoints.
How to help: The Heroku service would be slow to load and the Pythonanywhere service need renewing each 3 months. If I get 5 Euro together (fund via GitHub Sponsors), then I can get a Hacker Account on Pythonanywhere.com. They are pretty cool and we should fund them (through me^^)!
Head over to ammanvms.github.io/SpaceAPIStatusImage and configure the service.
To view a list of hosts, visit the web page or docs/index.html
.
If you host it yourself, consider adding your host to the list.
API:
/
redirects to the configuration./status
redirects to the image.
Parameters:url
required - a url to the SpaceAPI endpointopen
optional - a url to an image to show when the space is open.
This will replace the image specified instate->icon->open
.closed
optional - a url to an image to show when the space is closed.
This will replace the image specified instate->icon->closed
.status
optional - use to replace thestatus->open
value. Values:open
orclosed
.
Examples (copy the link because it redirects):
If you want, you can serve this from Pythonanywhere.com.
- Create a free account.
- Open a console.
- Run
pwd
to find your directory name. - Follow the Server Setup
- Create a
web
with the app using the path frompwd
plus/SpaceAPIStatusImage/app.py
.
You will need git
, python3
and python3-pip
installed.
- Clone the repo
git clone https://github.com/AmmanVMS/SpaceAPIStatusImage.git cd SpaceAPIStatusImage
- Install the packages.
pip3 install -r requirements.txt
Now, you are ready to go!
The server can be run by:
python3 app.py
These are parameters for configuration:
DEBUG
-true
(default) orfalse
Whether to add debug information.PORT
-5000
by default The port to serve from.INDEX
- a url to the configuration page,https://ammanvms.github.io/SpaceAPIStatusImage/
by default The url that serves the configuration files.
You can use Docker to build the project:
docker build --tag niccokunzmann/spaceapistatusimage .
This is how you run the built container:
docker run -d --rm -p 5000:80 niccokunzmann/spaceapistatusimage
Choose localhost:5000
as the server.
If you set up the server, you are fine to go. Pull requests welcome!
You have several ways to deploy this service.
Click this button to deploy this service to Heroku:
You can deploy to Pythonanywhere but then, you cannot access all URLs.
- Once pushed, head over to your pythonanywhere console and
run
cd SpaceAPIStatusImage git pull
- Reload the web service.
This software is free and licensed under AGPLv3.