kuuurt13 / local-noise

Ionic 2 App for Creating Spotify Playlists for Upcoming Concerts
2 stars 0 forks source link

Module "'../env" does not exist #1

Open kevinmauro92 opened 6 years ago

kevinmauro92 commented 6 years ago

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

kevinmauro92 commented 6 years ago

This is the stacktrace:

Error: Cannot find module "../env" at Object. (http://localhost:8101/build/main.js:28224:7) at webpack_require (http://localhost:8101/build/main.js:20:30) at Object. (http://localhost:8101/build/main.js:82677:73) at webpack_require (http://localhost:8101/build/main.js:20:30) at Object. (http://localhost:8101/build/main.js:82111:80) at webpack_require (http://localhost:8101/build/main.js:20:30) at Object. (http://localhost:8101/build/main.js:134957:70) at webpack_require (http://localhost:8101/build/main.js:20:30) at http://localhost:8101/build/main.js:66:18 at http://localhost:8101/build/main.js:69:10

kevinmauro92 commented 6 years ago

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?

kevinmauro92 commented 6 years ago

i wonder also why the login HTML page is not included? u r loading this from spotify's website?

kuuurt13 commented 6 years ago

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
};