So the first part of the instruction said make a get request for a turtles route, and send a JS object of the turtles and their colors, which I did here:
app.get('/turtles', function(req, res) {
data = {
Raphael: "Red",
Leonardo: "Blue",
Donatello: "Black",
Michaelangelo: "Orange"
}
console.log(data);
});
But the second part says make a get request for a 'turtles/:id' route that will send a string with the param: "The turtle you want to see is ------------" I'm not sure what I have to do.
app.get('/turtles/:id', function(req, res) {
data = {
Raphael: "Red",
Leonardo: "Blue",
Donatello: "Black",
Michaelangelo: "Orange"
}
What would I have to console log here? req.params.id?