2023-08-31 14:29:09 +04:00
|
|
|
import { RequestHandler } from "express";
|
2024-05-03 21:04:01 +02:00
|
|
|
import { IStatsView } from "@/src/types/statTypes";
|
|
|
|
import config from "@/config.json";
|
2023-12-14 17:34:15 +01:00
|
|
|
import view from "@/static/fixed_responses/view.json";
|
2024-05-03 21:04:01 +02:00
|
|
|
import allScans from "@/static/fixed_responses/allScans.json";
|
2023-08-31 14:29:09 +04:00
|
|
|
|
|
|
|
const viewController: RequestHandler = (_req, res) => {
|
2024-05-06 15:19:42 +02:00
|
|
|
const responseJson: IStatsView = view;
|
2024-05-03 21:04:01 +02:00
|
|
|
if (config.unlockAllScans) {
|
|
|
|
responseJson.Scans = allScans;
|
|
|
|
}
|
|
|
|
res.json(responseJson);
|
2023-08-31 14:29:09 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
export { viewController };
|