A companion API for my vscode-status-extension VSCode extension.
Tip
Use the /get-status endpoint along with ?userId=YOUR_USER_ID (found in settings of the extension) to retrieve your VSCode status to be displayed on your website!
- GET
https://vscode-status.powerpcfan.xyz/
- health check endpoint, returns{"message": "OK"}
if OK - POST
https://vscode-status.powerpcfan.xyz/update-status
- update's user's status. Requires token and user ID. - GET
https://vscode-status.powerpcfan.xyz/get-status
- retrieves the user's status from the API. You only need the user ID.
Warning
This API uses rate limiting through Flask-Limiter, but most proxying and tunneling services interfere with this, since it uses IP-based limiting.
If you are using Cloudflare Tunnel, set the CLOUDFLARE_TUNNEL value to "true"
(explained below), and if you are using a different proxying/tunneling service, disable rate limiting entirely (also explained below).
- Clone the repository
- Install requirements.txt
- Set up .env file:
- Copy .env.example to .env
- Fill in the required values:
DISCORD_WEBHOOK_URL
- Optional URL for a Discord webhook. When set, the API will capture all stdout and stderr (including logs and print statements) and forward them to the webhook in small batches.CLOUDFLARE_TUNNEL
- Set to"true"
if you are using a Cloudflare tunnel,"false"
(default) if not.RATE_LIMITING
- Set to"true"
to enable IP-based rate limiting,"false"
to disable it. If you choose to use rate limiting you will need Memcached running on port 11211 (use WSL or Docker if on Windows). (!! Read warning at the top of this section !!)
cd
the./app
directory, then run the app usinggunicorn main:app --bind 0.0.0.0:5000 --workers 4
if you need a production WSGI server, orpython3 main.py
> follow on-screen instructions if you just want a development server.