uppy/examples/xhr-bundle
Renée Kooi 7b2283d8ef
examples: add npm run example script
a bad result from adding the examples as dependencies of the root
repository is that they now don't have access to the npm binaries they
need to run in their own folder, because they are installed into the
root repository instead.

this works around that issue.

we may need to consider undoing that change and making the examples work
as standalone projects again, that's easier to understand.

fixes #2024 for now.
2020-01-15 11:16:56 +01:00
..
.gitignore examples: Add XHRUpload bundle option example. 2018-01-08 11:52:45 +01:00
index.html examples: Add XHRUpload bundle option example. 2018-01-08 11:52:45 +01:00
main.js xhr-upload: send global metadata when bundle: true (#1677) 2019-07-05 17:11:57 +02:00
package.json lerna link convert (#1730) 2019-07-19 12:16:36 +02:00
readme.md examples: add npm run example script 2020-01-15 11:16:56 +01:00
serve.js examples: Add XHRUpload bundle option example. 2018-01-08 11:52:45 +01:00

XHR Bundle Upload

This example uses Uppy with XHRUpload plugin in bundle mode. Bundle mode uploads all files to the endpoint in a single request, instead of firing off a new request for each file. This makes uploading a bit slower, but it may be easier to handle on the server side, depending on your setup.

serve.js contains an example express.js server that receives a multipart form-data upload and responds with some information about the files that were received (name, size) as JSON. It uses multer to parse the upload stream.

Run it

To run this example, make sure you've correctly installed the repository root:

npm install

That will also install the dependencies for this example.

Then, again in the repository root, start this example by doing:

npm run example xhr-bundle