mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 17:55:08 +01:00
27 lines
792 B
TypeScript
27 lines
792 B
TypeScript
import { NextApiRequest, NextApiResponse } from 'next';
|
|
import { ok, methodNotAllowed } from 'next-basics';
|
|
|
|
export interface ConfigResponse {
|
|
basePath: string;
|
|
trackerScriptName: string;
|
|
updatesDisabled: boolean;
|
|
telemetryDisabled: boolean;
|
|
adminDisabled: boolean;
|
|
cloudMode: boolean;
|
|
}
|
|
|
|
export default async (req: NextApiRequest, res: NextApiResponse<ConfigResponse>) => {
|
|
if (req.method === 'GET') {
|
|
return ok(res, {
|
|
basePath: process.env.BASE_PATH || '',
|
|
trackerScriptName: process.env.TRACKER_SCRIPT_NAME,
|
|
updatesDisabled: !!process.env.DISABLE_UPDATES,
|
|
telemetryDisabled: !!process.env.DISABLE_TELEMETRY,
|
|
adminDisabled: !!process.env.DISABLE_ADMIN,
|
|
cloudMode: process.env.CLOUD_MODE,
|
|
});
|
|
}
|
|
|
|
return methodNotAllowed(res);
|
|
};
|