From c48c8fcb702fbec5077ba2bca34b9dcf1b966267 Mon Sep 17 00:00:00 2001 From: Ifedapo Olarewaju Date: Thu, 14 Jun 2018 02:37:59 +0100 Subject: [PATCH 1/3] refactor: rename host option to serverUrl --- README.md | 4 ++-- examples/aws-uppy-server/main.js | 4 ++-- examples/aws-uppy-server/server.js | 2 +- examples/bundled-example/main.js | 4 ++-- examples/custom-provider/client/MyCustomProvider.js | 2 +- examples/custom-provider/client/main.js | 4 ++-- examples/digitalocean-spaces/main.js | 2 +- examples/digitalocean-spaces/server.js | 2 +- examples/react-example/App.js | 2 +- examples/uppy-with-server/client/index.html | 4 ++-- src/plugins/AwsS3/Multipart.js | 6 +++--- src/plugins/AwsS3/index.js | 6 +++--- src/plugins/Dropbox/index.js | 6 +++--- src/plugins/GoogleDrive/index.js | 6 +++--- src/plugins/Instagram/index.js | 4 ++-- src/plugins/Transloadit/index.js | 6 +++--- src/plugins/Tus.js | 2 +- src/plugins/Url/index.js | 6 +++--- src/plugins/XHRUpload.js | 2 +- src/server/RequestClient.js | 4 ++-- src/server/RequestClient.test.js | 4 ++-- src/views/ProviderView/index.js | 6 +++--- types/index.d.ts | 10 +++++----- types/uppy-tests.ts | 4 ++-- website/src/docs/aws-s3-multipart.md | 4 ++-- website/src/docs/aws-s3.md | 6 +++--- website/src/docs/dropbox.md | 4 ++-- website/src/docs/google-drive.md | 4 ++-- website/src/docs/instagram.md | 4 ++-- website/src/docs/providers.md | 10 +++++----- website/src/docs/transloadit.md | 4 ++-- website/src/docs/url.md | 4 ++-- website/src/examples/dashboard/app.es6 | 8 ++++---- website/src/examples/dashboard/index.ejs | 6 +++--- website/src/examples/transloadit/app.es6 | 2 +- website/src/examples/transloadit/index.ejs | 2 +- 36 files changed, 80 insertions(+), 80 deletions(-) diff --git a/README.md b/README.md index 399f65481..5567060dc 100644 --- a/README.md +++ b/README.md @@ -33,8 +33,8 @@ const Tus = require('uppy/lib/plugins/Tus') const uppy = Uppy({ autoProceed: false }) .use(Dashboard, { trigger: '#select-files' }) - .use(GoogleDrive, { target: Dashboard, host: 'https://server.uppy.io' }) - .use(Instagram, { target: Dashboard, host: 'https://server.uppy.io' }) + .use(GoogleDrive, { target: Dashboard, serverUrl: 'https://server.uppy.io' }) + .use(Instagram, { target: Dashboard, serverUrl: 'https://server.uppy.io' }) .use(Webcam, { target: Dashboard }) .use(Tus, { endpoint: 'https://master.tus.io/files/' }) .on('complete', (result) => { diff --git a/examples/aws-uppy-server/main.js b/examples/aws-uppy-server/main.js index e9d967c00..d70f83fa9 100644 --- a/examples/aws-uppy-server/main.js +++ b/examples/aws-uppy-server/main.js @@ -10,7 +10,7 @@ const uppy = Uppy({ }) uppy.use(GoogleDrive, { - host: 'http://localhost:3020' + serverUrl: 'http://localhost:3020' }) uppy.use(Webcam) uppy.use(Dashboard, { @@ -19,5 +19,5 @@ uppy.use(Dashboard, { plugins: ['GoogleDrive', 'Webcam'] }) uppy.use(AwsS3, { - host: 'http://localhost:3020' + serverUrl: 'http://localhost:3020' }) diff --git a/examples/aws-uppy-server/server.js b/examples/aws-uppy-server/server.js index 602af9ba8..94fd0c31d 100644 --- a/examples/aws-uppy-server/server.js +++ b/examples/aws-uppy-server/server.js @@ -31,7 +31,7 @@ const options = { region: process.env.UPPYSERVER_AWS_REGION } }, - server: { host: 'localhost:3020' }, + server: { serverUrl: 'localhost:3020' }, filePath: DATA_DIR, secret: 'blah blah', debug: true diff --git a/examples/bundled-example/main.js b/examples/bundled-example/main.js index 9577ab674..65842ecad 100644 --- a/examples/bundled-example/main.js +++ b/examples/bundled-example/main.js @@ -28,8 +28,8 @@ const uppy = Uppy({ proudlyDisplayPoweredByUppy: true, note: '2 files, images and video only' }) - .use(GoogleDrive, { target: Dashboard, host: 'http://localhost:3020' }) - .use(Instagram, { target: Dashboard, host: 'http://localhost:3020' }) + .use(GoogleDrive, { target: Dashboard, serverUrl: 'http://localhost:3020' }) + .use(Instagram, { target: Dashboard, serverUrl: 'http://localhost:3020' }) .use(Webcam, { target: Dashboard }) .use(Tus, { endpoint: TUS_ENDPOINT }) .use(Form, { target: '#upload-form' }) diff --git a/examples/custom-provider/client/MyCustomProvider.js b/examples/custom-provider/client/MyCustomProvider.js index 38eea47d1..974f6c65c 100644 --- a/examples/custom-provider/client/MyCustomProvider.js +++ b/examples/custom-provider/client/MyCustomProvider.js @@ -16,7 +16,7 @@ module.exports = class MyCustomProvider extends Plugin { // writing out the key explicitly for readability the key used to store // the provider instance must be equal to this.id. this[this.id] = new Provider(uppy, { - host: this.opts.host, + serverUrl: this.opts.serverUrl, provider: 'mycustomprovider' }) diff --git a/examples/custom-provider/client/main.js b/examples/custom-provider/client/main.js index e6e25ae06..ab7df86ac 100644 --- a/examples/custom-provider/client/main.js +++ b/examples/custom-provider/client/main.js @@ -10,11 +10,11 @@ const uppy = Uppy({ }) uppy.use(GoogleDrive, { - host: 'http://localhost:3020' + serverUrl: 'http://localhost:3020' }) uppy.use(MyCustomProvider, { - host: 'http://localhost:3020' + serverUrl: 'http://localhost:3020' }) uppy.use(Dashboard, { diff --git a/examples/digitalocean-spaces/main.js b/examples/digitalocean-spaces/main.js index 8d6035409..51134326f 100644 --- a/examples/digitalocean-spaces/main.js +++ b/examples/digitalocean-spaces/main.js @@ -13,4 +13,4 @@ uppy.use(Dashboard, { }) // No client side changes needed! -uppy.use(AwsS3, { host: '/uppy-server' }) +uppy.use(AwsS3, { serverUrl: '/uppy-server' }) diff --git a/examples/digitalocean-spaces/server.js b/examples/digitalocean-spaces/server.js index aa4b95086..5b9e43fec 100644 --- a/examples/digitalocean-spaces/server.js +++ b/examples/digitalocean-spaces/server.js @@ -39,7 +39,7 @@ app.use('/uppy-server', uppy.app({ region: process.env.UPPYSERVER_AWS_REGION } }, - server: { host: `localhost:${PORT}` } + server: { serverUrl: `localhost:${PORT}` } })) // Serve the built CSS file. diff --git a/examples/react-example/App.js b/examples/react-example/App.js index 7d0b374ea..75043761c 100644 --- a/examples/react-example/App.js +++ b/examples/react-example/App.js @@ -20,7 +20,7 @@ module.exports = class App extends React.Component { componentWillMount () { this.uppy = new Uppy({ id: 'uppy1', autoProceed: true, debug: true }) .use(Tus, { endpoint: 'https://master.tus.io/files/' }) - .use(GoogleDrive, { host: 'https://server.uppy.io' }) + .use(GoogleDrive, { serverUrl: 'https://server.uppy.io' }) this.uppy2 = new Uppy({ id: 'uppy2', autoProceed: false, debug: true }) .use(Tus, { endpoint: 'https://master.tus.io/files/' }) diff --git a/examples/uppy-with-server/client/index.html b/examples/uppy-with-server/client/index.html index a8d253096..ebcd601e1 100644 --- a/examples/uppy-with-server/client/index.html +++ b/examples/uppy-with-server/client/index.html @@ -12,8 +12,8 @@