Fix: wrong endpoint type in handler logging

This commit is contained in:
Ninjdai 2023-12-12 14:46:47 +01:00
parent c13bbc7357
commit 4ce737a3dd

View File

@ -17,25 +17,11 @@ async function genHandler() {
const { default: endpoint } = await import(`.${pagesPath}/${file}`); const { default: endpoint } = await import(`.${pagesPath}/${file}`);
handler[endpoint.type].push(endpoint); handler[endpoint.type].push(endpoint);
console.log( console.log(
`\x1b[32mChargement de POST: ${endpoint.path} !\x1b[0m`, `\x1b[32mChargement de ${endpoint.type.toUpperCase()}: ${endpoint.path} !\x1b[0m`,
); );
numberOfPages++; numberOfPages++;
console.log(numberOfPages + " endpoints chargés ! "); console.log(numberOfPages + " endpoints chargés ! ");
} }
/*for (const category of endpointCategories) {
const endpointFiles = fs
.readdirSync(`${pagesPath}${category}`)
.filter((file) => file.endsWith(".js"));
for (const file of endpointFiles) {
const { default: endpoint } = await import(`.${pagesPath}${category}/${file}`);
handler[endpoint.type].push(endpoint);
console.log(
`\x1b[32mChargement de POST: ${endpoint.path} !\x1b[0m`,
);
numberOfPages++;
console.log(numberOfPages + " endpoints chargés ! ");
}
}*/
return handler; return handler;
} }