A Flask Web API that simulates the behavior of an audio file server.
-
git clone /~https://github.com/atoyegbe/filed_python_test.git
and change directory into the cloned folder. -
Create and activate a virtual environment for the project.
-
Run
pip install -r requirements.txt
-
set your environment variable :
export FLASK_APP="run.py"
export SECRET="your-secret-key"
export DATABASE_URL="your-app-database-url"
for the main database.export DATABASE_TEST_URL="your-test-databse-url"
for the test database.
-
Run
flask run
to start the project.
python test_api.py
to run the test file.
- song
- podcast
- audiobook
Methods | Url | Description |
---|---|---|
GET | /<AudioFileType>/<AudioFileID> |
Get a specific audio file. |
GET | /<AudioFileType> |
Get a list of all audio files. |
POST | /<AudioFileType> |
Create a new audio file. |
PUT | /<AudioFileType>/<AudioFileID> |
Update an exisiting audio file. |
DELTE | /<AudioFileType>/<AudioFileID> |
Delete an existing audio file. |