aboutsummaryrefslogtreecommitdiffstats
path: root/server/select.ts
blob: d209c381d1e69842f81c6e389d660cd2f500f1ff (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
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