mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-23 18:26:32 -05:00
Merge pull request #1093 from hedgedoc/config/changeMockUploadPath
This commit is contained in:
commit
edb184f3a3
3 changed files with 3 additions and 2 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -41,3 +41,4 @@ dist
|
|||
public/uploads/*
|
||||
!public/uploads/.gitkeep
|
||||
uploads
|
||||
test_uploads
|
||||
|
|
|
@ -10,7 +10,7 @@ export default registerAs('mediaConfig', () => ({
|
|||
backend: {
|
||||
use: 'filesystem',
|
||||
filesystem: {
|
||||
uploadPath: 'uploads',
|
||||
uploadPath: 'test_uploads',
|
||||
},
|
||||
},
|
||||
}));
|
||||
|
|
|
@ -36,7 +36,7 @@ export class FilesystemBackend implements MediaBackend {
|
|||
await this.ensureDirectory();
|
||||
try {
|
||||
await fs.writeFile(filePath, buffer, null);
|
||||
return ['/' + filePath, null];
|
||||
return ['/uploads/' + fileName, null];
|
||||
} catch (e) {
|
||||
this.logger.error((e as Error).message, (e as Error).stack, 'saveFile');
|
||||
throw new MediaBackendError(`Could not save '${filePath}'`);
|
||||
|
|
Loading…
Reference in a new issue