app.js 629 B

123456789101112131415161718
  1. import { Uppy } from '@uppy/core'
  2. import Dashboard from '@uppy/dashboard'
  3. import XHRUpload from '@uppy/xhr-upload'
  4. import Unsplash from '@uppy/unsplash'
  5. import Url from '@uppy/url'
  6. import '@uppy/core/dist/style.css'
  7. import '@uppy/dashboard/dist/style.css'
  8. const companionUrl = 'http://localhost:3020'
  9. const uppy = new Uppy()
  10. .use(Dashboard, { target: '#app', inline: true })
  11. .use(XHRUpload, { endpoint: 'https://xhr-server.herokuapp.com/upload', limit: 6 })
  12. .use(Url, { target: Dashboard, companionUrl })
  13. .use(Unsplash, { target: Dashboard, companionUrl })
  14. // Keep this here to access uppy in tests
  15. window.uppy = uppy