Commit d37d8cad authored by Lucas Gabriel Lima's avatar Lucas Gabriel Lima
Browse files

create carousel get route

parent 9fcb4727
Pipeline #9836 failed with stage
in 3 minutes and 59 seconds
......@@ -67,4 +67,13 @@ carouselApp.post('/', upload.single('image'), function (req, res, next) {
})
})
carouselApp.get('/', (req, res, next) => {
Carousel.find((err, images) => {
if(err) {
res.status(500).json({error: 'Erro do servidor', text: 'O servidor encontrou um erro ao processar a requisição', err});
}
res.json(images);
});
});
module.exports = carouselApp;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment