Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.
TypeScript analyticsaudience-segmentationchartscohort-analysisgoogle-analyticsproduct-analyticsstatisticsuser-journeyweb-analytics
add version endpoint
Francis Caoacb7fdcae8eb
diff --git a/src/pages/api/version.ts b/src/pages/api/version.tsnew file mode 100644index 000000000..4453b56f0--- /dev/null+++ b/src/pages/api/version.ts@@ -0,0 +1,17 @@+import { NextApiRequest, NextApiResponse } from 'next';+import { ok, methodNotAllowed } from 'next-basics';+import { CURRENT_VERSION } from 'lib/constants';++export interface VersionResponse {+ version: string;+}++export default async (req: NextApiRequest, res: NextApiResponse<VersionResponse>) => {+ if (req.method === 'GET') {+ return ok(res, {+ version: CURRENT_VERSION,+ });+ }++ return methodNotAllowed(res);+};