diff --git a/server.js b/server.js index 0003fb5..0f19496 100644 --- a/server.js +++ b/server.js @@ -14,6 +14,10 @@ const mysqlConnection = mysql.createConnection({ }); mysqlConnection.connect() +app.get('/songs', async (req, res)=>{ + const results = await mysqlConnection.awaitQuery("SELECT * FROM songs WHERE learned=True ORDER BY title ASC"); + res.json(results) +}) app.get('/instruments', async (req, res)=>{ const results = await mysqlConnection.awaitQuery("SELECT * FROM instruments"); res.json(results)