summary refs log tree commit diff
path: root/src/api/routes/updates.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/routes/updates.ts')
-rw-r--r--src/api/routes/updates.ts20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/api/routes/updates.ts b/src/api/routes/updates.ts
new file mode 100644
index 00000000..6019371e
--- /dev/null
+++ b/src/api/routes/updates.ts
@@ -0,0 +1,20 @@
+import { route } from "@fosscord/api";
+import { Config, Release } from "@fosscord/util";
+import { Request, Response, Router } from "express";
+
+const router = Router();
+
+router.get("/", route({}), async (req: Request, res: Response) => {
+	const { client } = Config.get();
+
+	const release = await Release.findOneOrFail({ where: { name: client.releases.upstreamVersion } });
+
+	res.json({
+		name: release.name,
+		pub_date: release.pub_date,
+		url: release.url,
+		notes: release.notes
+	});
+});
+
+export default router;