main.mjs 534 B

123456789101112131415161718192021
  1. import Uppy from '@uppy/core'
  2. import DragDrop from '@uppy/drag-drop'
  3. import Tus from '@uppy/tus'
  4. import ProgressBar from '@uppy/progress-bar'
  5. // const endpoint = 'http://localhost:1080'
  6. const endpoint = 'https://tusd.tusdemo.net'
  7. // Initialise Uppy with Drag & Drop
  8. const uppyDragDrop = new Uppy({
  9. id: 'uppyDragDrop',
  10. debug: true,
  11. autoProceed: true,
  12. })
  13. uppyDragDrop
  14. .use(DragDrop, {
  15. target: '#uppyDragDrop',
  16. })
  17. .use(ProgressBar, { target: '#uppyDragDrop-progress' })
  18. .use(Tus, { endpoint: `${endpoint}/files/` })