Thursday, January 26, 2023

90: Express, APIs, and JSON

 Today I got my Express server up and running and configured it to parse a JSON object sent as the body of a POST request. It extracts the to, from, subject, and email body from the object and then calls SendGrid to send it as an email. I tested it out with the Insomnia tool and got a successful email sent by manually sending a POST request to my local server with the JSON object. From there I created a new file that used the Axios library to send the POST with the object, and it worked like a charm. The next step is to now use the Axios library and integrate it into my frontend React app, so the data from the form can be parsed upon submission and sent to the backend Node server and processed for emailing. 



No comments:

Post a Comment

190: Sablier

 The CodeHawks platform has an upcoming audit on the Sablier protocol, so I decided to read through the docs and familiarize myself with the...