Posts by Edgar Silva • 53 points
4 posts
-
1
votes1
answer1551
viewsQ: Error handling in js Node
I’m doing an error treatment that if a wrong id is passed by url he returns a error 400, but when I take the test it returns a error 200 one more message "error": "Error", "message": "Cast to…
-
4
votes2
answers5329
viewsQ: The difference between req.params and req.query
I’m having a question about url parameters. Is the following, I know there’s a way I can rescue a parameter this way users/:id, Then I pick up with the req.params.id, but I saw a video that the guy…
node.jsasked Edgar Silva 53 -
0
votes2
answers98
viewsA: Create a controller to make a GET type request
Follow the code of my route GET: const express = require('express'); const User = require('../Models/index'); const router = express.Router(); router.get('timeline', (req, res) => { res.send({…
-
0
votes2
answers98
viewsQ: Create a controller to make a GET type request
I am creating a simple API with Ode that I do a news post, in this I am using express to create my routes of my application, I have already managed to create a controller that posts my news, but I…