disable public api

This commit is contained in:
Mutasem 2022-05-03 11:12:39 +02:00
parent ae02d60c03
commit 886e5164fb

View file

@ -58,14 +58,15 @@ function createApiRouter(
} }
export const loadPublicApiVersions = async (): Promise<express.Router[]> => { export const loadPublicApiVersions = async (): Promise<express.Router[]> => {
const swaggerThemePath = path.join(__dirname, 'swaggerTheme.css'); // const swaggerThemePath = path.join(__dirname, 'swaggerTheme.css');
const folders = await fs.readdir(__dirname); // const folders = await fs.readdir(__dirname);
const css = (await fs.readFile(swaggerThemePath)).toString(); // const css = (await fs.readFile(swaggerThemePath)).toString();
const versions = folders.filter((folderName) => folderName.startsWith('v')); // const versions = folders.filter((folderName) => folderName.startsWith('v'));
const apiRouters: express.Router[] = []; // const apiRouters: express.Router[] = [];
for (const version of versions) { // for (const version of versions) {
const openApiPath = path.join(__dirname, version, 'openapi.yml'); // const openApiPath = path.join(__dirname, version, 'openapi.yml');
apiRouters.push(createApiRouter(version, openApiPath, __dirname, css)); // apiRouters.push(createApiRouter(version, openApiPath, __dirname, css));
} // }
return apiRouters; // return apiRouters;
return [];
}; };