Ver código fonte

website: switch to the new upload-endpoint in xhr-example (#1782)

* use the new upload-endpoint in xhr example

* remove unused “bundle” example

* update dev Dashboard example with new xhr test endpoint
Artur Paikin 5 anos atrás
pai
commit
aa9b2edcd3

+ 3 - 3
examples/dev/Dashboard.js

@@ -10,11 +10,11 @@ const Tus = require('@uppy/tus/src')
 const Form = require('@uppy/form/src')
 
 const TUS_ENDPOINT = 'https://master.tus.io/files/'
-// const XHR_ENDPOINT = 'https://api2.transloadit.com'
+// const XHR_ENDPOINT = 'https://upload-endpoint.uppy.io/upload'
 
 module.exports = () => {
   const uppyDashboard = Uppy({
-    debug: true,
+    logger: Uppy.debugLogger,
     meta: {
       username: 'John',
       license: 'Creative Commons'
@@ -38,7 +38,7 @@ module.exports = () => {
     .use(Url, { target: Dashboard, companionUrl: 'http://localhost:3020' })
     .use(Webcam, { target: Dashboard })
     .use(Tus, { endpoint: TUS_ENDPOINT })
-    // .use(XHRUpload, { endpoint: XHR_ENDPOINT })
+    // .use(XHRUpload, { endpoint: XHR_ENDPOINT, bundle: true })
     .use(Form, { target: '#upload-form' })
     // .use(GoldenRetriever, {serviceWorker: true})
 

+ 0 - 13
website/src/examples/bundle/app.html

@@ -1,13 +0,0 @@
-<link rel="stylesheet" href="/uppy/uppy.min.css">
-
-<div id="uppy-dnd"></div>
-
-<script src="/uppy/uppy.min.js"></script>
-<script>
-  var uppy = Uppy.Core({debug: true});
-  uppy.use(Uppy.Tus, {endpoint: '//master.tus.io/files/'});
-  uppy.use(Uppy.DragDrop, {target: '#uppy-dnd'});
-  uppy.use(Uppy.ProgressBar);
-
-  console.log('Uppy loaded from CDN with tus enabled');
-</script>

+ 0 - 23
website/src/examples/bundle/index.ejs

@@ -1,23 +0,0 @@
----
-title: Bundle
-layout: example
-order: 2
-category: 'Examples'
----
-
-{% blockquote %}
-This example showcases using a pre-built bundle from a CDN.
-{% endblockquote %}
-
-<% include app.html %>
-
-<hr />
-
-<p id="console-wrapper">
-  Console output: <br />
-</p>
-
-<p>
-  On this page we're using the following HTML & JS snippet:
-</p>
-{% include_code lang:html bundle/app.html %}

+ 1 - 1
website/src/examples/xhrupload/app.es6

@@ -15,7 +15,7 @@ uppy.use(ProgressBar, {
   hideAfterFinish: false
 })
 uppy.use(XHRUpload, {
-  endpoint: '//api2.transloadit.com',
+  endpoint: 'https://upload-endpoint.uppy.io/upload',
   formData: true,
   fieldName: 'files[]'
 })

+ 1 - 1
website/src/examples/xhrupload/app.html

@@ -2,7 +2,7 @@
 <link rel="stylesheet" href="/uppy/uppy.min.css">
 
 <div class="UppyForm">
-  <form action="//api2.transloadit.com">
+  <form action="https://upload-endpoint.uppy.io/upload">
     <h5>Uppy was not loaded — slow connection, unsupported browser, weird JS error on a page — but the upload still works, because HTML is cool like that</h5>
     <input type="file" name="files[]" multiple="">
     <button type="submit">Fallback Form Upload</button>