Skip to content

Commit

Permalink
examples: add some knobs to the dev example
Browse files Browse the repository at this point in the history
Because I keep typing the same thing over and over again to test S3 or
Transloadit uploads for example. Figure it will be easier just to toggle
some of these values instead :)
  • Loading branch information
goto-bus-stop committed Dec 2, 2019
1 parent a4c4486 commit 419a27d
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion examples/dev/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,37 @@ const Dropbox = require('@uppy/dropbox/src')
const GoogleDrive = require('@uppy/google-drive/src')
const Url = require('@uppy/url/src')
const Webcam = require('@uppy/webcam/src')
const GoldenRetriever = require('@uppy/golden-retriever/src')
const Tus = require('@uppy/tus/src')
const AwsS3 = require('@uppy/tus/src')
const XHRUpload = require('@uppy/xhr-upload/src')
const Transloadit = require('@uppy/transloadit/src')
const Form = require('@uppy/form/src')
const GoldenRetriever = require('@uppy/golden-retriever/src')

// DEV CONFIG: pick an uploader

const UPLOADER = 'tus'
// const UPLOADER = 's3'
// const UPLOADER = 'xhr'
// const UPLOADER = 'transloadit'

// DEV CONFIG: Endpoint URLs

const COMPANION_URL = 'http://localhost:3020'
const TUS_ENDPOINT = 'https://master.tus.io/files/'
const XHR_ENDPOINT = 'https://upload-endpoint.uppy.io/upload'

// DEV CONFIG: Transloadit keys

const TRANSLOADIT_KEY = '...'
const TRANSLOADIT_TEMPLATE = '...'

// DEV CONFIG: enable or disable Golden Retriever

const RESTORE = false

// Rest is implementation! Obviously edit as necessary...

module.exports = () => {
const uppyDashboard = Uppy({
logger: Uppy.debugLogger,
Expand Down Expand Up @@ -68,6 +77,14 @@ module.exports = () => {
case 'xhr':
uppyDashboard.use(XHRUpload, { endpoint: XHR_ENDPOINT, bundle: true })
break
case 'transloadit':
uppyDashboard.use(Transloadit, {
params: {
auth: { key: TRANSLOADIT_KEY },
template_id: TRANSLOADIT_TEMPLATE
}
})
break
}

if (RESTORE) {
Expand Down

0 comments on commit 419a27d

Please sign in to comment.