Parameters

(None)

Returns

NameTypeDescription
(Returns)Array<Object>list of users
nameString user's name
ageNumber user's age
(defined in /examples/api.js:11)
app.get('/users', (req, res) => {
  res.json([
    { name: 'John Doe', age: 30 },
    { name: 'Bill Smith', age: 23 },
  ]);
});

Parameters

NameTypeDescription
nameString user's name
ageNumber user's age

Returns

NameTypeDescription
(Returns)Objectinformation of created user
idNumber user record ID
(defined in /examples/api.js:26)
app.post('/users', (req, res) => {
  res.json({ id: 1 });
});

app.listen(3000);
Fork me on GitHub