https://github.com/fecony/weyer-nodejs-server
🚧 Abandoned Service used to get token from Spotify API
https://github.com/fecony/weyer-nodejs-server
Last synced: about 2 months ago
JSON representation
🚧 Abandoned Service used to get token from Spotify API
- Host: GitHub
- URL: https://github.com/fecony/weyer-nodejs-server
- Owner: fecony
- Created: 2019-03-12T20:29:47.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-06-09T05:56:59.000Z (almost 4 years ago)
- Last Synced: 2025-02-15T04:27:38.252Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 46.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Weyer server to request token from Spotify API
> ###### MAYBE THAT IS NOT RIGH WAY TO WORK WITH API
Client Credentials Flow - server-to-server authentication.
This service is used to:
- Get Spotify Token
- Refresh Token
- Fetch tracks/albums by search query
- Get track by ID.---
## Development
In order to start developing, register a Spotify Application here:
https://developer.spotify.com/my-applicationsWrite the below commands in your terminal (replacing XXXX AND YYYY with your acutal `client id` and `secret` from the page where you registered your application)
```
npm install
export SPOTIFY_CLIENT_ID=XXXX
export SPOTIFY_CLIENT_SECRET=YYYY
npm start
```Then you can use _`URL/tracks?query=[search_query]&type=[track/album]`_ to fetch tracks/albums by search query.
And _`URL/tracks/[tack_id]`_ to fetch data about track by ID.---
## Production
This template is intended to be deployed on Heroku. After installing the Heroku CLI tools you can run the below commands in the same directory as server.js.
> Heroku will create a random name for application. You can rename it adding `name` after `heroku create` command
```
heroku create [name]
heroku config:set SPOTIFY_CLIENT_ID=XXXX
heroku config:set SPOTIFY_CLIENT_SECRET=YYYY
git push heroku master
```Calling _http://`name`.herokuapp.com/tracks`?query=[search_text]&type=[track_type/album_type]`_ to get 18 tracks found by search query.
Calling _http://`name`.herokuapp.com/tracks/`[track_id]`_ will return track by it's ID