aboutsummaryrefslogtreecommitdiffstats
path: root/server/select.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/select.ts')
-rw-r--r--server/select.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/server/select.ts b/server/select.ts
new file mode 100644
index 0000000..d209c38
--- /dev/null
+++ b/server/select.ts
@@ -0,0 +1,13 @@
+import { Router } from "express";
+import { songs } from "./data/songs";
+import { obfuscateSong } from "./shared";
+
+export const selectRouter = Router();
+
+selectRouter.get("/select", (_req, res) => {
+ const song = songs[Math.floor(Math.random() * songs.length)];
+
+ res.json({
+ data: obfuscateSong(song),
+ });
+});
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage