aboutsummaryrefslogtreecommitdiffstats
path: root/server/select.ts
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2026-06-06 13:25:10 -0700
committerPinapelz <yukais@pinapelz.com>2026-06-06 13:25:10 -0700
commitbc183a487c97b96041507091854958fc78d22011 (patch)
tree6b6c9d540bd4af05e173bbf1d38de60ea6f4a805 /server/select.ts
parentd3bd7f522ef750d809e9cdb6067a34dc3d1a9273 (diff)
server: seperate backend logic into routers
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