Browse Source

Merge pull request #131 from transloadit/uppy-server-v2

Uppy server v2
Harry Hedger 8 years ago
parent
commit
2565b37ca5
5 changed files with 11 additions and 11 deletions
  1. 1 1
      example/main.js
  2. 4 4
      package.json
  3. 4 4
      src/plugins/GoogleDrive/index.js
  4. 1 1
      src/plugins/Tus10.js
  5. 1 1
      src/uppy-base/src/plugins/Provider.js

+ 1 - 1
example/main.js

@@ -16,7 +16,7 @@ const uppy = new Core({debug: true, autoProceed: false})
   .use(Dummy, {target: Dashboard})
   .use(Webcam, {target: Dashboard})
   // .use(ProgressBar, {target: Dashboard})
-  .use(Tus10, {endpoint: '//tusd.tus.io/files/', resume: true})
+  .use(Tus10, {endpoint: 'https://tusd.tus.io/files/', resume: true})
   .use(Informer, {target: Dashboard})
   .use(MetaData, {
     fields: [

+ 4 - 4
package.json

@@ -1,6 +1,6 @@
 {
   "name": "uppy",
-  "version": "0.10.2",
+  "version": "0.10.1",
   "description": "Almost as cute as a Puppy :dog:",
   "main": "lib/index.js",
   "jsnext:main": "src/index.js",
@@ -81,7 +81,7 @@
     "tus-js-client": "1.4.1",
     "uppy-base": "git+https://github.com/hedgerh/uppy-base.git",
     "whatwg-fetch": "1.0.0",
-    "yo-yo": "1.3.1"
+    "yo-yo": "1.3.0"
   },
   "scripts": {
     "build:bundle": "node ./bin/build-js.js",
@@ -110,11 +110,11 @@
     "test:serve": "npm-run-all web:build --parallel start:server web:serve",
     "test:next-update": "next-update",
     "travis:deletecache": "travis cache --delete",
-    "watch:css": "nodemon --watch src --ext scss -x 'npm run build:css'",
+    "watch:css": "nodemon --watch src --ext scss -x \"npm run build:css\"",
     "watch:js": "nodemon --watch src --ext js -x 'npm run build:bundle'",
     "watch": "npm-run-all --parallel watch:js watch:css",
     "watch:fast": "npm-run-all --parallel watch:css web:preview",
-    "watch:example:browsersync": "browser-sync start --server example --port 3452 --serveStatic 'dist' --files 'example/bundle.js, dist/uppy.min.css'",
+    "watch:example:browsersync": "browser-sync start --server example --port 3452 --serveStatic dist --files \"example/bundle.js, dist/uppy.min.css\"",
     "watch:example:js": "watchify -t [ babelify ] example/main.js -o example/bundle.js -vd",
     "watch:example": "npm-run-all --parallel watch:example:js watch:css watch:example:browsersync",
     "web:build": "cd website && node update.js && ./node_modules/.bin/hexo generate --silent && node build-examples.js",

+ 4 - 4
src/plugins/GoogleDrive/index.js

@@ -23,7 +23,7 @@ export default class Google extends Plugin {
 
     this.GoogleDrive = new Provider({
       host: this.opts.host,
-      provider: 'google'
+      provider: 'drive'
     })
 
     this.files = []
@@ -109,7 +109,7 @@ export default class Google extends Plugin {
    * @return {Promise} authentication status
    */
   checkAuthentication () {
-    return fetch(`${this.opts.host}/google/authorize`, {
+    return fetch(`${this.opts.host}/drive/auth`, {
       method: 'get',
       credentials: 'include',
       headers: {
@@ -131,7 +131,7 @@ export default class Google extends Plugin {
 
       return res.json()
     })
-    .then((data) => data.isAuthenticated)
+    .then((data) => data.authenticated)
     .catch((err) => err)
   }
 
@@ -203,7 +203,7 @@ export default class Google extends Plugin {
       },
       remote: {
         host: this.opts.host,
-        url: `${this.opts.host}/google/get?fileId=${file.id}`,
+        url: `${this.opts.host}/drive/get/${file.id}`,
         body: {
           fileId: file.id
         }

+ 1 - 1
src/plugins/Tus10.js

@@ -155,7 +155,7 @@ export default class Tus10 extends Plugin {
           'Content-Type': 'application/json'
         },
         body: JSON.stringify(Object.assign({}, file.remote.body, {
-          target: this.opts.endpoint,
+          endpoint: this.opts.endpoint,
           protocol: 'tus'
         }))
       })

+ 1 - 1
src/uppy-base/src/plugins/Provider.js

@@ -30,7 +30,7 @@ export default class Provider {
   }
 
   list (directory = 'root') {
-    return fetch(`${this.opts.host}/${this.provider}/list?dir=${directory}`, {
+    return fetch(`${this.opts.host}/${this.provider}/list/${directory}`, {
       method: 'get',
       credentials: 'include',
       headers: {