An unfinished, minimalistic, general purpose API with versatility in mind.
Public instance: https://api.cobaltonline.net/
See /
for a list of endpoints.
You'll need Git, Python 3.8+, and Poetry installed for this.
-
- Clone this Git repository
git clone https://github.com/cobaltgit/CobaltAPI.git
-
- Install dependencies* with Poetry
poetry install
* to install development dependencies, do poetry install --dev
-
- Modify the
settings.py
file
- Modify the
To run your instance on a different host, port, turn off debug mode, etc... just manipulate the settings.py
file - the start script will handle the rest.
private_settings.py
contains sensitive information (e.g API tokens) that should not be committed to the Git repository. You can copy its template and adjust it to your needs.
The number of workers will scale to the number of CPU threads available on your system, as per Gunicorn's recommendations (nproc * 2 + 1
) - for example, a virtual machine with 2 CPU threads will run 5 workers.
-
- Serve it up!
python3 run.py