mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-27 12:08:02 -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/*
|
||||||
!public/uploads/.gitkeep
|
!public/uploads/.gitkeep
|
||||||
uploads
|
uploads
|
||||||
|
test_uploads
|
||||||
|
|
|
@ -10,7 +10,7 @@ export default registerAs('mediaConfig', () => ({
|
||||||
backend: {
|
backend: {
|
||||||
use: 'filesystem',
|
use: 'filesystem',
|
||||||
filesystem: {
|
filesystem: {
|
||||||
uploadPath: 'uploads',
|
uploadPath: 'test_uploads',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
|
@ -36,7 +36,7 @@ export class FilesystemBackend implements MediaBackend {
|
||||||
await this.ensureDirectory();
|
await this.ensureDirectory();
|
||||||
try {
|
try {
|
||||||
await fs.writeFile(filePath, buffer, null);
|
await fs.writeFile(filePath, buffer, null);
|
||||||
return ['/' + filePath, null];
|
return ['/uploads/' + fileName, null];
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.logger.error((e as Error).message, (e as Error).stack, 'saveFile');
|
this.logger.error((e as Error).message, (e as Error).stack, 'saveFile');
|
||||||
throw new MediaBackendError(`Could not save '${filePath}'`);
|
throw new MediaBackendError(`Could not save '${filePath}'`);
|
||||||
|
|
Loading…
Reference in a new issue