- login to your mysql database and create new database.
- In the file
config/config.json
update the value for theusername
,password
,database
, 'host' key according to your newly created mysql database. - Create a
.env
file in the root of the project. The expected contents are in a later section. - Build the project:
npm i
- Create the database tables:
npm run migrate
- Start the REST server: npm run server
- Test the queries with your favorite app (Postman, Curl, etc.)
To restore the DB to it's blank state: npm run migrate:undo
path | method | query params | body params |
---|---|---|---|
/track/add | POST | ISRC (string) idx* (int) |
|
/artist/search | GET | q (string) artist substring search term | |
/artist/search/isrc | GET | q (string) an exact ISRC | |
/artist/search/song | GET | q (string) song substring search term |
* Spotify returns a track with an array of several items, idx is the index (0 to n-1) to be used.
Key | Value |
---|---|
STORAGE | Absolute path to a sqlite3 database file |
SPOTIFY_AUTH | Basic <base64 string> The base64 string should adhere to the requirements from the Authorization Code Flow section of the Spotify Authorization Guide, namely: client_id:client_secret |
SPOTIFY_BASE_AUTH_URL | https://accounts.spotify.com/ |
SPOTIFY_BASE_URL | https://api.spotify.com/ |
SPOTIFY_TOKEN_ENDPOINT | api/token |
SPOTIFY_SEARCH_ENDPOINT | v1/search |
PORT | Defaults to 3001 or set to your choice |