From 5ec4b7ad3796dd50474a13d25d836a692dd418a8 Mon Sep 17 00:00:00 2001 From: Agusti Fernandez Pardo <6601142+agustif@users.noreply.github.com> Date: Sat, 25 Jun 2022 07:37:29 +0200 Subject: [PATCH] feat: adds new version endpoint in internal api (#3155) Co-authored-by: Agusti Fernandez Pardo Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- apps/web/pages/api/version.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 apps/web/pages/api/version.ts diff --git a/apps/web/pages/api/version.ts b/apps/web/pages/api/version.ts new file mode 100644 index 0000000000..9b05eef8ab --- /dev/null +++ b/apps/web/pages/api/version.ts @@ -0,0 +1,10 @@ +import type { NextApiRequest, NextApiResponse } from "next"; +import * as pjson from "package.json"; + +type Response = { + version: string; +}; + +export default async function handler(req: NextApiRequest, res: NextApiResponse): Promise { + return res.status(200).json({ version: pjson.version }); +}