Open kevinmauro92 opened 6 years ago
This is the stacktrace:
Error: Cannot find module "../env"
at Object.
Nevermind I think I figured out the problem... Do u think you could provide a sample ../env module, including the login URL? Is the loginURL somewhere on the included server directory or to Spotify's web API? Also can you provide an example credential structure?
i wonder also why the login HTML page is not included? u r loading this from spotify's website?
I didn't include env since they are environment variable which shouldn't be publicly available. Below I included what my env looks like. I authenticated myself and explicitly set my creds so when testing I don't have to login every time if I clear local storage.
As for a login url that is provided by spotify. I do have a callback endpoints in the server directory at server/modules/spotify/controllers/auth
since spotify follows OAuth 2.0 for authentication. I would suggest you read https://developer.spotify.com/web-api/authorization-guide/ to get a better idea on how it works. Let me know if you still have questions and I will try my best to help.
export const ENV = {
ENVIRONMENT: currentENV,
API_URL: currentENV === 'dev' ? '<local_dev_api>' : '<prod_api>',
SPOTIFY_CREDENTIALS: currentENV === 'dev' ? {
id: '<spotify_id>',
token: '<spotify_token>',
refresh: '<spotify_refresh_token>'
} : null
};
Hey, when trying to compile the app, I get an error that "../env" does not exist.
I really just want to know if i can use your example to figure out the streaming music API for spotify users? Do u think this is possible? Also solving the error would be cool since I want to explore your server and other stuff. Thanks, kevin