I've learned how to handle different HTTP methods (like GET and POST) in my server-side code. Additionally, I've grasped the concept of using the fetch API on the client side to send requests to these routes.
I've learned the process of sending data from the client to the server using the fetch API. Specifically, I've learned how to collect form data using the FormData API, convert it to a JSON object, and send it as JSON in the body of a POST request. On the server side, I now know how to access this data from the req.body property.
My understanding now includes querying data from a PostgreSQL database using the pg library. I've mastered the use of the pool.query method to send SQL queries to the database and retrieve the results.
I've gained the ability to connect to a PostgreSQL database using the pg library. Furthermore, I've learned the importance of closing the database connection when it's no longer needed.
I've acquired the skill of converting JavaScript objects to JSON strings using JSON.stringify, and vice versa, parsing JSON strings back into JavaScript objects using JSON.parse.
I've become proficient in handling errors in asynchronous code using try/catch blocks. Additionally, I've learned how to send appropriate HTTP status codes based on the outcome of the operation.