Skip to content

Commit b05336d

Browse files
committed
Try fixing image storage
1 parent d3cc8e6 commit b05336d

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

.diploi/diploi-storage-adapter.js

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
1-
// # Local File System Storage module
2-
// The (default) module for storing media, using the local file system
1+
// # Local File System Image Storage module
2+
// The (default) module for storing images, using the local file system
33
const config = require('../../../shared/config');
4+
const urlUtils = require('../../../shared/url-utils');
45
const LocalStorageBase = require('./LocalStorageBase');
56

6-
class DiploiStorage extends LocalStorageBase {
7+
const messages = {
8+
notFound: 'Image not found',
9+
notFoundWithRef: 'Image not found: {file}',
10+
cannotRead: 'Could not read image: {file}',
11+
};
12+
13+
class DiploiImagesStorage extends LocalStorageBase {
714
constructor() {
815
super({
9-
storagePath: '/data',
16+
storagePath: '/data/images',
17+
staticFileURLPrefix: urlUtils.STATIC_IMAGE_URL_PREFIX,
1018
siteUrl: config.getSiteUrl(),
11-
staticFileURLPrefix: '',
19+
errorMessages: messages,
1220
});
1321
}
1422
}
1523

16-
module.exports = DiploiStorage;
24+
module.exports = DiploiImagesStorage;

0 commit comments

Comments
 (0)