From 7d2445b05a7f074a63c121c4569dde32d3b5b749 Mon Sep 17 00:00:00 2001 From: Matthew Huntington Date: Thu, 1 Jan 2026 19:10:24 -0500 Subject: [PATCH] songs route --- server.js | 4 ++++ 1 file changed, 4 insertions(+) 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)