From 5e86d7ab9c5200d794c3adb2b422d20a2aefd2ce Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Sat, 13 Aug 2022 02:00:50 +0200 Subject: restructure to single project --- src/api/routes/updates.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/api/routes/updates.ts (limited to 'src/api/routes/updates.ts') diff --git a/src/api/routes/updates.ts b/src/api/routes/updates.ts new file mode 100644 index 00000000..a24e94c1 --- /dev/null +++ b/src/api/routes/updates.ts @@ -0,0 +1,20 @@ +import { Router, Response, Request } from "express"; +import { route } from "@fosscord/api"; +import { Config, Release } from "@fosscord/util"; + +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; -- cgit 1.4.1