mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-25 03:06:31 -05:00
Add media upload route to MediaController
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
4851e2c31c
commit
99614f8f3a
1 changed files with 17 additions and 2 deletions
|
@ -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')
|
@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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue