Skip to content

Latest commit

 

History

History
61 lines (43 loc) · 1.23 KB

README.md

File metadata and controls

61 lines (43 loc) · 1.23 KB

music-api

REST API created using FastAPI and SQLite3 with a music database 🎵
SQLAlchemy was not used as I wanted to expand my knowledge of SQL by implementing raw SQL

Endpoints

Artist

1

Album

2

Song

3

Quick Start

Install dependencies:

git clone https://github.com/dsymbol/music-api
pip install -r requirements.txt

Generate database and run the API:

python src/database.py
python -m uvicorn --port 5000 server:app

You can view the API docs by visiting http://localhost:5000

Example

Request:

GET http://localhost:5000/api/artist?name=drake

Response:

[
  {
    "artist_id": 3,
    "name": "Drake",
    "first_name": "Aubrey",
    "last_name": "Graham",
    "phone": "615-541-4518",
    "website": "drakerelated.com",
    "is_group": false
  }
]

PyTest

Tests are independent of each other, database must be reset after every test file ran.