mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-14 21:10:34 +01:00
add version endpoint
This commit is contained in:
parent
da3cc9b065
commit
acb7fdcae8
17
src/pages/api/version.ts
Normal file
17
src/pages/api/version.ts
Normal file
@ -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);
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user