mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
* Dynamic routes for API * New structure * Change next config * Refactoring tests * Fix newline * Fix tests * Remove dynamic from config * Apply suggestions from code review Co-Authored-By: Joe Haddad <[email protected]> * Update index.test.js
8 lines
192 B
JavaScript
8 lines
192 B
JavaScript
export default ({ query, method }, res) => {
|
|
if (method === 'POST') {
|
|
res.status(200).json([{ title: query.title }])
|
|
} else {
|
|
res.status(200).json([{ title: 'Cool Post!' }])
|
|
}
|
|
}
|