o2r-project / o2r-transportar

Superseeded by https://github.com/o2r-project/o2r-transporter
http://o2r.info
Apache License 2.0
0 stars 0 forks source link

Add download of complete compendium as archive #1

Closed nuest closed 7 years ago

nuest commented 8 years ago

Base on https://github.com/archiverjs/node-archiver/blob/master/examples/express.js (seems to do some streaming magic!)

/api/v1/compendium/<id>/download?format={zip,tar}

(format is optional, default is zip

nuest commented 7 years ago

https://hub.docker.com/r/o2rproject/o2r-transportar/builds/

nuest commented 7 years ago
Global setup completed
Mon, 19 Sep 2016 13:54:38 GMT mocha:runner run suite TAR downloader
  TAR downloader
Mon, 19 Sep 2016 13:54:38 GMT mocha:runner run suite TAR downloader POST new compendium and remember ID
    POST new compendium and remember ID

      ✓ Should respond without error and ID in response body (82ms)
Mon, 19 Sep 2016 13:54:38 GMT mocha:runner run suite TAR downloader GET non-existing compendium
    GET non-existing compendium

      ✓ should respond with HTTP 404 error at .tar

      ✓ should respond with HTTP 404 error at tar.gz
Mon, 19 Sep 2016 13:54:38 GMT mocha:runnable timeout 2000
Mon, 19 Sep 2016 13:54:38 GMT mocha:runnable enableTimeouts false
Mon, 19 Sep 2016 13:54:38 GMT mocha:runnable timeout 75

      ✓ should mention "no compendium" in the error message at .tar
    Downlad compendium using .tar
Mon, 19 Sep 2016 13:54:38 GMT mocha:runner run suite TAR downloader Downlad compendium using .tar

      ✓ should respond with HTTP 200 (80ms)

      ✓ content-type should be tar (75ms)

      ✓ content disposition is set to file name attachment (76ms)
      ✓ content-type should be tar gz (98ms)

      ✓ content disposition is set to file name attachment (93ms)

      ✓ downloadeded file is a gzipped tar archive (can be extracted, files exist) (145ms)
  ZIP downloader
Mon, 19 Sep 2016 13:54:39 GMT mocha:runner run suite ZIP downloader
Mon, 19 Sep 2016 13:54:39 GMT mocha:runner run suite ZIP downloader POST new compendium and remember ID
    POST new compendium and remember ID

      ✓ Should respond without error and ID in response body (51ms)
Mon, 19 Sep 2016 13:54:39 GMT mocha:runner run suite ZIP downloader GET non-existing compendium
    GET non-existing compendium

      ✓ should respond with HTTP 404 error

      ✓ should mention "no compendium" in the error message
Mon, 19 Sep 2016 13:54:39 GMT mocha:runner run suite ZIP downloader Downlad compendium
    Downlad compendium

      ✓ should respond with HTTP 200 (115ms)

      ✓ content-type should be zip (120ms)

      ✓ content disposition is set to file name attachment (137ms)

      ✓ downloaded file is a zip (can be extracted, files exist) (94ms)

      ✓ zip file comment is correct (96ms)
Mon, 19 Sep 2016 13:54:40 GMT mocha:runner finished running
Mon, 19 Sep 2016 13:54:40 GMT mocha:runner end
  21 passing (2s)
nuest commented 7 years ago

https://github.com/o2r-project/o2r-web-api/commit/8b0679ddac6735a12425b73ed0e66f395e420bbc

nuest commented 7 years ago
nuest commented 7 years ago

https://o2r.uni-muenster.de/api/v1/compendium/LvMW1.zip