internalfx/rethinkdb-regrid

Multipart/form-data uploads and nginx

Closed this issue · 3 comments

I'm trying to wrap my head around how this works here.

Currently, I'm using:
https://github.com/expressjs/multer
to upload my files and I'm saving them straight to disk. I like the performance nginx offers when serving static files:
http://blog.modulus.io/supercharge-your-nodejs-applications-with-nginx

Is it possible to upload my files using regrid and then serving the files through nginx?

Unfortunately no.

A regrid driver would have to be developed for nginx.

ReGrid works almost entirely with streams. So you can replace....

function (req, res) {
  fs.createReadStream('/videos/video.mp4').pipe(res)
}

with...

function (req, res) {
  bucket.downloadFilename('/videos/video.mp4').pipe(res)
}

@roblav96 If you are testing this, you will want to update to 0.4.0 The API changed significantly.

Ah I see. I'll have to update and play around with it. Thank you!