I want to create a book API. With the very basic 'post' command I'm trying to add a new book to the database. But when I return it postman shows me the already added books in the database. And returning 'null' instead of my newly added book.
Here's the code: (To add a new Book)
app.post("/book", (req,res) => {
const {newBook} = req.body;
db.books.push(newBook);
return res.json(db.books);
})