Add media upload route to MediaController

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2020-07-26 21:20:49 +02:00
parent 06b0d19c4b
commit f98bf0d32d
No known key found for this signature in database
GPG key ID: 6017AF117F9756CB

View file

@ -1,4 +1,19 @@
import { Controller } from '@nestjs/common';
import {
Controller,
Logger,
Post,
UploadedFile,
UseInterceptors,
} from '@nestjs/common';
import { FileInterceptor } from '@nestjs/platform-express';
@Controller('media')
export class MediaController {}
export class MediaController {
private readonly logger = new Logger(MediaController.name);
@Post('upload')
@UseInterceptors(FileInterceptor('file'))
uploadImage(@UploadedFile() file) {
this.logger.debug('Recieved file: ' + file);
}
}