ghost-storage-adapter-s3-bartt
Advanced tools
Comparing version 0.1.4-development to 0.1.5-development
@@ -57,6 +57,9 @@ 'use strict'; | ||
signatureVersion = config.signatureVersion, | ||
acl = config.acl; | ||
acl = config.acl, | ||
staticFileURLPrefix = config.staticFileURLPrefix; | ||
this.staticFileURLPrefix = staticFileURLPrefix; | ||
// Compatible with the aws-sdk's default environment variables | ||
this.accessKeyId = accessKeyId; | ||
@@ -185,3 +188,3 @@ this.secretAccessKey = secretAccessKey; | ||
that.s3().putObject(config, function (err, data) { | ||
return err ? reject(err) : resolve(`${that.host}/${fileName}`); | ||
return err ? reject(err) : resolve(`/${that.staticFileURLPrefix}/${(0, _path.relative)(this.pathPrefix, fileName)}`); | ||
}); | ||
@@ -188,0 +191,0 @@ }); |
@@ -77,3 +77,3 @@ { | ||
}, | ||
"version": "0.1.4-development" | ||
"version": "0.1.5-development" | ||
} |
import AWS from 'aws-sdk' | ||
import BaseStore from 'ghost-storage-base' | ||
import { join } from 'path' | ||
import { join, relative } from 'path' | ||
import { readFile } from 'fs' | ||
@@ -27,5 +27,8 @@ import {MAGIC_MIME_TYPE, Magic} from 'mmmagic' | ||
signatureVersion, | ||
acl | ||
acl, | ||
staticFileURLPrefix | ||
} = config | ||
this.staticFileURLPrefix = staticFileURLPrefix | ||
// Compatible with the aws-sdk's default environment variables | ||
@@ -146,3 +149,3 @@ this.accessKeyId = accessKeyId | ||
that.s3().putObject(config, function (err, data) { | ||
return err ? reject(err) : resolve(`${that.host}/${fileName}`) | ||
return err ? reject(err) : resolve(`/${that.staticFileURLPrefix}/${relative(this.pathPrefix, fileName)}`) | ||
}) | ||
@@ -149,0 +152,0 @@ }) |
29311
362