AudioTap is a simulator app for an Audio FileServer
Swagger / OpenAPI can be accessed at localhost:8000/docs
- Clone the repository, install dependencies and start the service
git clone https://github.com/almique/audiotap
./bin/install_deps
./bin/start_service
- Use Postman or CLI or Swagger UI to query
- Clone the repository, install dependencies and run the tests
git clone https://github.com/almique/audiotap
./bin/install_deps
./bin/run_tests
- If the tests are successful you should see the following
Uploads an Audio for a given File Type and Audio ID to the database
- Create a new Song
curl -X 'POST' \
'http://localhost:8000/create?audioId=1&audioFileType=Song' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"name": "Yellow",
"uploadTime": "2021-04-04T01:17:09.017Z",
"duration": 3278
}'
- Create a new Audiobook
curl -X 'POST' \
'http://localhost:8000/create?audioId=1&audioFileType=Audiobook' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"name": "Nonviolent Communication",
"uploadTime": "2021-04-04T01:17:09.017Z",
"duration": 3278,
"author": "Marshall Rosenberg",
"narrator": "Marshall Rosenberg",
}'
- Create a new Podcast
curl -X 'POST' \
'http://localhost:8000/create?audioId=1&audioFileType=Podcast' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"name": "Leadership Skills",
"uploadTime": "2021-04-04T01:17:09.017Z",
"duration": 3278,
"host": "Jay Cornwall",
"participants": ["John", "Bob"]
}'
{
"msg": "Success",
"audioId": 1,
"audioFileType": "Song"
}
Deletes an Audio for a given File Type and Audio ID
curl -X 'GET' \
'http://localhost:8000/delete/Song/1' \
-H 'accept: application/json'
Updates an Audio for a given File Type and Audio ID with new data
curl -X 'POST' \
'http://localhost:8000/update/Song/1' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"name": "Cemeteries of London",
"uploadTime": "2021-04-04T01:23:11.847Z",
"duration": 3279
}'
{
"name": "Cemeteries of London",
"uploadTime": "2021-04-04T01:23:11.847000",
"duration": 3279,
"audioFileType": "Song",
"audioId": 1
}
Fetches an Audio for a given File Type and Audio ID
curl -X 'GET' \
'http://localhost:8000/get/Song/1' \
-H 'accept: application/json'
{
"name": "Cemeteries of London",
"uploadTime": "2021-04-04T01:23:11.847000",
"duration": 3279,
"audioFileType": "Song",
"audioId": 1
}
Fetches all Audio for a given File Type
curl -X 'GET' \
'http://localhost:8000/get/Song/' \
-H 'accept: application/json'
[
{
"name": "Levitating",
"uploadTime": "2022-04-03T22:47:00.028000",
"duration": 1243,
"audioFileType": "Song",
"audioId": 1
},
{
"name": "Good Life",
"uploadTime": "2021-04-04T02:01:18.493000",
"duration": 2782,
"audioFileType": "Song",
"audioId": 2
}
]