mercredi 21 février 2018

Is it possible with json-server use custom routes to handle buffer responses?

Is possible to do this custom route in json-server

server.get('/retrievebinary', (req, res) => {
  res.set('Content-type', 'application/octet-stream');
  res.send(new Buffer('whooop'));
});

I don't get any response I think json-server is not supporting buffers. Here is the documentation about custom routes.

Aucun commentaire:

Enregistrer un commentaire