rsnext/examples/api-routes-rest/pages/api/users.js
Lukáš Huvar 83a3903fc2 HTTP methods docs and REST example (#8108)
* HTTP methods docs and REST example

* Update packages/next/README.md

Co-Authored-By: Joe Haddad <timer150@gmail.com>

* Update examples/api-routes-rest/README.md

Co-Authored-By: Joe Haddad <timer150@gmail.com>

* Fix standard
2019-07-25 11:18:38 -04:00

13 lines
178 B
JavaScript

// Fake users data
const users = [
{
id: 1
},
{ id: 2 },
{ id: 3 }
]
export default (req, res) => {
// Get data from your database
res.status(200).json(users)
}