aboutsummaryrefslogtreecommitdiffstats
path: root/server/index.ts
blob: 57998818728fcd1fc68e2ed7075c145a7080982a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import express from "express";
import cors from "cors";
import dotenv from "dotenv";
import { dailyRouter } from "./daily";
import { selectRouter } from "./select";

dotenv.config();

const app = express();
app.use(cors());
app.use(express.json());

const SERVER_PORT = process.env.SERVER_PORT || 3001;

app.use(dailyRouter);
app.use(selectRouter);

const enableDailyMusicVideo = process.env.ENABLE_DAILY_MUSIC_VIDEO === "true";

app.route("/info")
    .get((_, res) => {
        res.json({
          dailyMusic: true, // for now assume daily heardle is always playable (bare minimum for instance)
          dailyMV: enableDailyMusicVideo, // signify to worker whether daily MV guessing should be ran
        });
    });

app.listen(SERVER_PORT, () => console.log(`Server running on :${SERVER_PORT}`));
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage