This is the serverless "backend" for audial.
/daily
- returns the daily random track, as well as every possible track from that playlist for searching.
fetch(`http://localhost:5000/daily?playlist=${spotify.playlist.id}&random=${true}&locale=${date.string}`,
{ method: 'GET' }
);
You can generate a locale string using new Date().toDateString();
Setup firebase using their CLI
Login to your firebase account (optional)
firebase login
Test changes on your local instance
firebase emulators:start --only functions,database
Deploy the functions and database to your app
firebase deploy --only functions,database
Generate a Spotify App from their developer dashboard
Copy the Client ID and Client Secret into a .env
file in the functions directory.
SPOTIFY_CLIENT=''
SPOTIFY_SECRET=''