Remote app for Spotify.
App uses spotify-web-api-node for authentication/authorization.
Live app can be found here.
You'll need to create a new Spotify app through their dashboard to get a new Client ID and Client Secret. In the app settings add http://localhost:3000/
to the Redirect URIs.
EITHER make a .env file OR hard code the ID and Secret into server.js
Make a new .env file in the root directory containing:
CLIENT_ID="< insert Client ID here >"
CLIENT_SECRET="< insert Client Secret here >"
REDIRECT_URI="http://localhost:3000/"
On line 13:
const credentials = {
clientId: "< insert Client ID here >",
clientSecret: "< insert Client Secret here >",
redirectUri: "http://localhost:3000/",
}
- 20
- 49
- 50
- 51
- 22
- 23
- 24
useAuth.js
can be found in client/components/useAuth.js
Change line 9 to:
.post("http://localhost:8000/login", { code })
spotify.js
can be found in client/components/spotify.js
Change lines 2 and 3 to:
const redirectUri = "http://localhost:3000/"
const clientId = "< insert Client ID here >"
Remote.js
can be found in client/pages/Remote.js
Change line 11 to:
clientId: "< insert Client ID here >",
npm install
node server.js
cd client
npm install
npm start
Client should be at http://localhost:3000/
and server at http://localhost:8000/