fix(apis): résoudre le chemin absolu avant sendFile

res.sendFile() ne supporte pas les chemins relatifs — path.resolve()
convertit ./docs-output/... en chemin absolu avant l'envoi.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
z3n
2026-05-29 13:46:00 +00:00
parent f27542e71f
commit 3a98b87ccf

View File

@@ -52,7 +52,8 @@ export class ApisController {
async getDocs(@Param('id') id: string, @Res() res: Response) {
const entry = await this.apisService.findOneOrThrow(id);
if (!entry.htmlPath) throw new NotFoundException('Documentation not generated yet');
res.sendFile(entry.htmlPath);
const absolutePath = path.resolve(entry.htmlPath);
res.sendFile(absolutePath);
}
@Get(':id/yaml')