summaryrefslogtreecommitdiff
path: root/backend/src/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'backend/src/index.ts')
-rw-r--r--backend/src/index.ts23
1 files changed, 23 insertions, 0 deletions
diff --git a/backend/src/index.ts b/backend/src/index.ts
new file mode 100644
index 0000000..58c5080
--- /dev/null
+++ b/backend/src/index.ts
@@ -0,0 +1,23 @@
+import express from "express";
+import cors from "cors";
+import { WORDLIST } from "./wordlist";
+
+const PORT = 4000;
+const app = express();
+app.use(cors());
+
+app.get("/healthcheck", (req, res) => {
+ res.send("HEALTHY");
+});
+
+app.get("/random-words", (req, res) => {
+ res.send(
+ new Array(16)
+ .fill(0)
+ .map(() => WORDLIST[Math.round(Math.random() * WORDLIST.length)])
+ );
+});
+
+app.listen(PORT, () => {
+ console.log("Initialized");
+});