NodeJS server for the spotify artist explorer app, see the browser client.
This is a simple app that handles the OAuth 2 access token
-> request token
for Spotify. It runs as a Google Cloud Function (GCF). See the Spotify Authorization Guide.
npm install
- Copy
.env.example
->.env
. - Add a PORT, eg 3000.
- If not already done, register a Spotify Test App on a dev account.
- Add the client ID (
SPOTIFY_CLIENT_ID
), client secret (SPOTIFY_CLIENT_SECRET
) from the spotify app dashboard. - For local dev add the redirect url (
SPOTIFY_REDIRECT_URI
), should use the domain of the locally runningspotify-artist-explorer-client
website eg'http://localhost:8080/auth.html'
. - Add this redirect url to the list of Redirect URIs on your Spotify App (Dashboard -> Settings -> Redirect URIs).
npm run test
- Convert express app to GCF, eg:
module.exports = function(request, response) {
...
}
https://cloud.google.com/functions/docs/concepts/nodejs-10-runtime
https://cloud.google.com/functions/docs/writing/#structuring_source_code
- CORS, eg see this.
- Implement development environment.
- Dockerize
- Unit tests
- Integration test
- Healthcheck?
- GCF deploy
https://cloud.google.com/functions/docs/deploying/repo
- CORS?
- GitHub hook for tests?
- Codecov