bd31c5d1b7
* 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 <timer150@gmail.com> * Update index.test.js
7 lines
192 B
JavaScript
7 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!' }])
|
|
}
|
|
}
|