-
Notifications
You must be signed in to change notification settings - Fork 529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Books API by Helene Westrin #526
base: master
Are you sure you want to change the base?
Conversation
…d filtering on the first letter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well structured and quite advanced project, nice that you broke it up into chunks and dared to go further than the requirements! Love your eagerness as well, it's not until next week we're working with POST requests 😉
}; | ||
|
||
// Add a new book | ||
export const addBook = (req, res) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, ambitious ⭐
const saveBooks = (books) => { | ||
fs.writeFileSync(booksFilePath, JSON.stringify(books, null, 2)); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this going to change the books.json file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, Matilda!
Yes, it writes to books.json and adds the new book at the end.
Vercel link
Test the API »