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 4851e2c31c
commit 99614f8f3a
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3

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);
}
}