Complete the code to handle creating a new resource using the correct HTTP method.
app.[1]('/items', (req, res) => { res.send('Create item'); });
The POST method is used to create new resources on the server.
Complete the code to handle reading a resource using the correct HTTP method.
app.[1]('/items/:id', (req, res) => { res.send('Read item ' + req.params.id); });
The GET method is used to read or retrieve data from the server.
Fix the error in the code by choosing the correct HTTP method to update a resource.
app.[1]('/items/:id', (req, res) => { res.send('Update item ' + req.params.id); });
The PUT method is used to update an existing resource completely.
Fill both blanks to handle deleting a resource using the correct HTTP method and path.
app.[1]('/items/[2]', (req, res) => { res.send('Delete item ' + req.params.id); });
DELETE method is used to remove a resource, and ':id' is the path parameter for the resource ID.
Fill all three blanks to create a full CRUD route for updating an item by ID using Express.
app.[1]('/items/[2]', (req, res) => { const id = req.params.[3]; res.send('Update item ' + id); });
PUT is the HTTP method for updating, ':id' is the route parameter, and 'id' accesses that parameter in code.