Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
signingUrlQueryParams: this.props.signingUrlQueryParams,
signingUrlHeaders: this.props.signingUrlHeaders,
uploadRequestHeaders: this.props.headers || this.props.uploadRequestHeaders,
contentDisposition: this.props.contentDisposition,
onProgress: this.onProgress,
onFinishS3Put: this.onFinish,
onError: this.onError,
server: this.props.server || this.props.host || '',
}, this.props.uploaderOptions)
if (this.props.preprocess) options.preprocess = this.props.preprocess
new S3Upload(options) // eslint-disable-line
this.props.onDrop && this.props.onDrop(files, rejectedFiles)
}
export default function setup(app, done) {
log('start setup')
Aws.config.update({
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
})
app.use(noFavicon())
app.use(helmet())
app.use(compression())
app.use('/image', S3Router({
bucket: process.env.S3_IMAGE_BUCKET,
region: process.env.AWS_REGION,
signatureVersion: 'v4',
headers: { 'Access-Control-Allow-Origin': '*' },
ACL: 'public-read',
uniquePrefix: true,
}))
if (DEV) {
const clientConfig = require('../../webpack/client.dev')
const serverConfig = require('../../webpack/server.dev')
const webpackDevMiddleware = require('webpack-dev-middleware')
const webpackHotMiddleware = require('webpack-hot-middleware')
const webpackHotServerMiddleware = require('webpack-hot-server-middleware')
const publicPath = clientConfig.output.publicPath