How to get a file stored with nodejs and multer?

0

In the API, in NodeJS, that I am doing, the user sends the image to the API and, using the multer, the image is stored. All the tutorials I saw for this situation, the Node is using a preprocessor like jade, ejs, handlebars etc. But in my case, the front is done in Vuejs. So, how do I make the API "show" the searched image? If I try to access localhost:3000/api/company/public/minha-imagem.jgp the following error appears Cannot GET /api/company/public/minha-imagem.jpg .

    
asked by anonymous 11.07.2018 / 16:23

1 answer

0

Solution. In my app.js , I inserted app.use('/dist', express.static(path.join(__dirname + '/dist')));

    
12.07.2018 / 14:08