Files
oneuptime/Common/Server/API/GlobalConfigAPI.ts
Nawaz Dhandala 6d5bc111ba Refactor comments across multiple files to improve clarity and consistency
- 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.
2025-10-02 11:53:55 +01:00

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);
}
},
);
}
}