summary refs log tree commit diff
path: root/src/api/routes/updates.ts
blob: 6019371e9fdb10f92ac31908af644e367c9150ca (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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;