rsnext/test/integration/api-support/pages/api/posts/index.js
Lukáš Huvar fedfbd9d5c Experimental API support (#7296)
* First basic API support

* Change require functionality

* Change 501 to 404

* Change wording

* Fix test
2019-05-11 13:18:56 +02:00

6 lines
168 B
JavaScript

export default (req, res) => {
res.writeHead(200, { 'Content-Type': 'application/json' })
const json = JSON.stringify([{ title: 'Cool Post!' }])
res.end(json)
}