mirror of
https://github.com/kremalicious/umami.git
synced 2024-06-28 16:57:52 +02:00
23 lines
655 B
TypeScript
23 lines
655 B
TypeScript
import { NextApiRequest, NextApiResponse } from 'next';
|
|
import { ok, methodNotAllowed } from 'next-basics';
|
|
|
|
export interface ConfigResponse {
|
|
telemetryDisabled: boolean;
|
|
trackerScriptName: string;
|
|
uiDisabled: boolean;
|
|
updatesDisabled: boolean;
|
|
}
|
|
|
|
export default async (req: NextApiRequest, res: NextApiResponse<ConfigResponse>) => {
|
|
if (req.method === 'GET') {
|
|
return ok(res, {
|
|
telemetryDisabled: !!process.env.DISABLE_TELEMETRY,
|
|
trackerScriptName: process.env.TRACKER_SCRIPT_NAME,
|
|
uiDisabled: !!process.env.DISABLE_UI,
|
|
updatesDisabled: !!process.env.DISABLE_UPDATES,
|
|
});
|
|
}
|
|
|
|
return methodNotAllowed(res);
|
|
};
|