sails-upstream
Convert sails request req
to stream, which can be used to pipe body (include file uploaded) to other request,
such as http-proxy
.
Install
$ npm install sails-upstream --save
Usage
Proxy request.
// api/policies/upstream.jsconst httpProxy = ;const RequestStream = ; const proxy = httpProxy; moduleexports = req res next proxy;;
Upload file to buffer.
// api/controller/TestController.jsconst httpProxy = ;const fileBuffer = ; moduleexports = async { const buffer = await ; };