A template API for a basic accounts system.
- GET
- POST
- PUT
- PATCH
- DELETE
Access tokens to be set in administrators.json
"username": {
"name": 1 (number),
"level": Permission level (number),
"check": Access token (string),
"method": Hashing algotrithm (string)
}- Home access
- GET access
- POST access
- PUT/PATCH access
- DELETE access
- ROOT access
- Home access
- GET access
- POST access
- PUT/PATCH access
- DELETE access
- ROOT access
- Home access
- GET access
- POST access
- PUT/PATCH access
- DELETE access
- ROOT access
- Home access
- GET access
- POST access
- PUT/PATCH access
- DELETE access
- ROOT access
The API is built on Python, which means that it is easy to run.
Dependencies:
mysql.connector: pip install mysql.connector
flask: pip install flask
waitress: pip install waitress
- Create a new virtual envrionment using
python -m venv venv - Move the files into the virtual environment
- Activate the virtual environment via
bash bin/activateon MacOS and Linux orscripts/activateon Windows - Install
waitressas shown above and runwaitress-serve --port 80 "v2:app". On MacOS and Linux, run this withsudopermissions. - Head to 127.0.0.1 (localhost) and onto your desired enpoint.
- Install Node.JS and npm: https://nodejs.org
- Install
node-fetchusingnpm install node-fetch - Edit the test suite to your desired enpoint and URL
- Run
node testing.jsin a different terminal to the one with your API. Make sure you keep the API running!