Skip to content

Commit

Permalink
Updates with ssl disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
nmagee committed Nov 18, 2024
1 parent f1bbcb7 commit 61801b7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
from mysql.connector import Error
import json
import os
from mysql.connector import RefreshOption

refresh = RefreshOption.LOG | RefreshOption.THREADS

DBHOST = "ds2022.cqee4iwdcaph.us-east-1.rds.amazonaws.com"
DBUSER = "admin"
Expand All @@ -32,7 +35,7 @@ def zone_apex():

@app.get('/genres')
async def get_genres():
db = mysql.connector.connect(user=DBUSER, host=DBHOST, password=DBPASS, database=DB)
db.cmd_refresh(refresh)
query = "SELECT * FROM genres ORDER BY genreid;"
try:
cur.execute(query)
Expand All @@ -48,7 +51,7 @@ async def get_genres():

@app.get('/songs')
async def get_genres():
cur = db.cursor()
db.cmd_refresh(refresh)
query = "SELECT songs.title, songs.album, songs.artist, songs.year, songs.file, songs.image, genres.genre FROM songs JOIN genres WHERE songs.genre = genres.genreid;"
try:
cur.execute(query)
Expand Down

0 comments on commit 61801b7

Please sign in to comment.