How to use the react-s3-uploader/s3router function in react-s3-uploader

To help you get started, we’ve selected a few react-s3-uploader examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jkettmann / universal-react-relay-starter-kit / server / render / setup.js View on Github external
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

react-s3-uploader

React component that renders a file input and automatically uploads to an S3 bucket

MIT
Latest version published 4 years ago

Package Health Score

53 / 100
Full package analysis

Popular react-s3-uploader functions