re-arranged user flow to display assignment first, with the optional button to access information from spotify.
This commit is contained in:
+3
-10
@@ -1,8 +1,6 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"fmt"
|
||||
"github.com/joho/godotenv"
|
||||
"log"
|
||||
"net/http"
|
||||
@@ -10,22 +8,17 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
func generateRandomString(length int) string {
|
||||
var b = make([]byte, length)
|
||||
rand.Read(b)
|
||||
return fmt.Sprintf("%x", b)
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
err := godotenv.Load("../music/.env")
|
||||
err := godotenv.Load("../music/explore/.env")
|
||||
if err != nil {
|
||||
log.Fatalf("Error loading .env file: %s", err)
|
||||
}
|
||||
|
||||
client_id := os.Getenv("SPOTIFY_CLIENT_ID")
|
||||
redirect_uri := "https://cs2440.joshashton.dev/music"
|
||||
redirect_uri := "https://cs2440.joshashton.dev/music/explore"
|
||||
//redirect_uri := "http://localhost/music/explore"
|
||||
scope := "user-top-read"
|
||||
|
||||
redirectURL := "https://accounts.spotify.com/authorize?" + strings.Join([]string{
|
||||
|
||||
Reference in New Issue
Block a user