Complete the code to define a REST API endpoint for users following naming conventions.
app.get('/[1]', (req, res) => { res.send('User list'); });
The resource name should be plural and lowercase, so users is correct.
Complete the code to name a resource for blog posts correctly.
const router = express.Router(); router.get('/[1]', (req, res) => { res.send('Posts'); });
Resource names should be plural and lowercase, so posts is correct.
Fix the error in the resource naming for a product API endpoint.
app.post('/[1]', (req, res) => { res.send('Create product'); });
Resource names should be plural and lowercase, so products is correct.
Fill both blanks to correctly name a nested resource for comments on posts.
app.get('/[1]/[2]', (req, res) => { res.send('Comments for post'); });
Use plural nouns for both parent and nested resources: posts and comments.
Fill all three blanks to correctly name a resource and its ID parameter in the URL.
app.get('/[1]/:[2]/[3]', (req, res) => { res.send('Specific item detail'); });
The URL uses plural resource names and descriptive ID parameters: products, productId, and reviews.