mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
- Updated comments in Probe/Config.ts to use block comments for proxy configuration. - Refactored comments in PortMonitor.ts, SyntheticMonitor.ts, and OnlineCheck.ts to block comments for better readability. - Adjusted comments in ProbeIngest/API/Monitor.ts and ProbeIngest/API/Probe.ts to block comments for clarity. - Standardized comments in various data migration scripts to block comments for consistency. - Modified eslint.config.js to enforce multiline comment style as an error.
50 lines
1.3 KiB
TypeScript
50 lines
1.3 KiB
TypeScript
import GlobalConfigService, {
|
|
Service as GlobalConfigServiceType,
|
|
} from "../Services/GlobalConfigService";
|
|
import {
|
|
ExpressRequest,
|
|
ExpressResponse,
|
|
NextFunction,
|
|
} from "../Utils/Express";
|
|
import Response from "../Utils/Response";
|
|
import BaseAPI from "./BaseAPI";
|
|
import GlobalConfig from "../../Models/DatabaseModels/GlobalConfig";
|
|
|
|
export default class GlobalConfigAPI extends BaseAPI<
|
|
GlobalConfig,
|
|
GlobalConfigServiceType
|
|
> {
|
|
public constructor() {
|
|
super(GlobalConfig, GlobalConfigService);
|
|
|
|
this.router.get(
|
|
`${new this.entityType().getCrudApiPath()?.toString()}/vars`,
|
|
async (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => {
|
|
try {
|
|
/*
|
|
* const globalConfig: GlobalConfig | null =
|
|
* await GlobalConfigService.findOneById({
|
|
* id: ObjectID.getZeroObjectID(),
|
|
* select: {
|
|
* useHttps: true,
|
|
* },
|
|
* props: {
|
|
* isRoot: true,
|
|
* },
|
|
* });
|
|
*/
|
|
|
|
return Response.sendJsonObjectResponse(req, res, {
|
|
/*
|
|
* USE_HTTPS:
|
|
* globalConfig?.useHttps?.toString() || 'false',
|
|
*/
|
|
});
|
|
} catch (err) {
|
|
next(err);
|
|
}
|
|
},
|
|
);
|
|
}
|
|
}
|