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:
@@ -52,7 +52,8 @@ export class ApisController {
|
|||||||
async getDocs(@Param('id') id: string, @Res() res: Response) {
|
async getDocs(@Param('id') id: string, @Res() res: Response) {
|
||||||
const entry = await this.apisService.findOneOrThrow(id);
|
const entry = await this.apisService.findOneOrThrow(id);
|
||||||
if (!entry.htmlPath) throw new NotFoundException('Documentation not generated yet');
|
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')
|
@Get(':id/yaml')
|
||||||
|
|||||||
Reference in New Issue
Block a user