diff --git a/src/server.js b/src/server.js index 099e3ac..4eb5c3d 100644 --- a/src/server.js +++ b/src/server.js @@ -24,7 +24,8 @@ var redirect_uri = process.env.CALLBACK; // Your redirect uri var environment = process.env.NODE_ENV || 'prod'; /** - * Generates a random string containing numbers and letters + * Generates a random string containing numbers and letters. + * From Spotify tutorial. * @param {number} length The length of the string * @return {string} The generated string */ @@ -49,6 +50,9 @@ if (environment == 'prod' || environment == 'production') { app.use(express.static(__dirname + '/public')) .use(cookieParser()); +/** + * From Spotify tutorial. + */ app.get('/login', function (req, res) { var state = generateRandomString(16); @@ -66,6 +70,9 @@ app.get('/login', function (req, res) { })); }); +/** + * From Spotify tutorial. + */ app.get('/callback', function (req, res) { // your application requests refresh and access tokens @@ -117,6 +124,9 @@ app.get('/callback', function (req, res) { } }); +/** + * From Spotify tutorial. + */ app.get('/refresh_token', function (req, res) { // requesting access token from refresh token