2
I’m still new on these sides and I’m making an application in Ode (I think...). I’ve written my routes this way example:
routes.get('/produtos', mostrarProdutos)
routes.get('/produtos/:id', mostrarPorId)
routes.post('/produtos', novoProduto)
So I was hanging around and I did a test that worked out that way:
routes.get('/produtos', mostrarProdutos)
.get('/produtos/:id', mostrarPorId)
.post('/produtos', novoProduto)
Is it good practice this last way? Does it give any problem? Is there any way to decrease further?
Why further reduce? Smaller code is not necessarily better, I suggest you read the first paragraph of this answer :-)
– hkotsubo
Yeah, hkotsubo’s right, I heard something like that a while back. I just asked this to see if I could optimize my time and not write similar code in a much larger application.
– OcoringaJoker