Categories
express inputstream node.js

nodejs input stream using express

Is there a way that using express a route consumer can send an input stream to the endpoint and read it?

In short I want the endpoint user upload a file by streaming it instead of the multipart/form way. Something like:

app.post('/videos/upload', (request, response) => {
const stream = request.getInputStream();
const file = stream.read();
stream.on('done', (file) => {
//do something with the file
});
});

Is it possible to do it?