diff --git a/src/file/file.controller.ts b/src/file/file.controller.ts index 29f24ae..231d06c 100644 --- a/src/file/file.controller.ts +++ b/src/file/file.controller.ts @@ -34,6 +34,15 @@ export class FileController { } } + @Post('upload.txt') + @UseInterceptors(FileInterceptor('file')) + @ApiConsumes('multipart/form-data') + @Render('file/upload-result') + async handleFileSilentUpload(@UploadedFile() file: Express.Multer.File): Promise { + const upload = await this.fileService.handleFileUpload(file); + return `https://api.us.dev/file/${upload.key}` + } + @Post('upload.json') @UseInterceptors(FileInterceptor('file')) @ApiConsumes('multipart/form-data')