aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/utility/SpotifyAPI.java
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.moe>2023-11-22 23:19:48 -0800
committerPinapelz <yukais@pinapelz.com>2023-11-22 23:19:48 -0800
commit60a320dc9e680868608efbd2e46ae0910b8ba5f2 (patch)
tree6e273ae7dbf6c6f91e1af17cf9fd1331d5666836 /src/main/java/utility/SpotifyAPI.java
parent499fe2a90287c5a84a4b32ebc43fc7a609e8871c (diff)
Added a Procfile
- change settings config to env vars - allows for easier Heroku deployment Signed-off-by: Pinapelz <yukais@pinapelz.com>
Diffstat (limited to 'src/main/java/utility/SpotifyAPI.java')
-rw-r--r--src/main/java/utility/SpotifyAPI.java12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/main/java/utility/SpotifyAPI.java b/src/main/java/utility/SpotifyAPI.java
index 4eb4d6e..acf79eb 100644
--- a/src/main/java/utility/SpotifyAPI.java
+++ b/src/main/java/utility/SpotifyAPI.java
@@ -83,15 +83,11 @@ public class SpotifyAPI {
}
}
public static String readSetting(String parameter){
- Object obj = null;
-
- try {
- obj = new JSONParser().parse(new FileReader("settings//config.json"));
- } catch (Exception e) {
- e.printStackTrace();
+ String value = System.getenv(parameter);
+ if (value != null) {
+ return value;
}
- JSONObject jo = (JSONObject) obj;
- return (String) jo.get(parameter);
+ throw new RuntimeException("Environment variable " + parameter + " not found");
}
public static void checkRefreshToken(){
long unixTime = Instant.now().getEpochSecond();
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage