From 419a27ddcbf1bf1a76487ee9820713160d99faef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9e=20Kooi?= Date: Mon, 2 Dec 2019 15:49:13 +0100 Subject: [PATCH] examples: add some knobs to the dev example 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 :) --- examples/dev/Dashboard.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/examples/dev/Dashboard.js b/examples/dev/Dashboard.js index ee6aca19f8..0168b5eadb 100644 --- a/examples/dev/Dashboard.js +++ b/examples/dev/Dashboard.js @@ -7,17 +7,19 @@ 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 @@ -25,10 +27,17 @@ 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, @@ -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) {