First PR to merge so not sure I did it correctly or if I am messing with the branches.
About the PR itself.
Added a new end point /api/chat into server.js
It is a post request because comes with a message in the body
the main action is carried on by a new function openaiRequest (message) which is in a different file.
How I tested?
I used Postman to create a post request with a "message" in the body.
You can also do a quick test with curl
curl -X POST http://localhost:5000/api/chat \
-H "Content-Type: application/json" \
-d '{"message": "Can you explain what a promise is in JavaScript?"}'
First PR to merge so not sure I did it correctly or if I am messing with the branches.
About the PR itself.
How I tested? I used Postman to create a post request with a "message" in the body. You can also do a quick test with curl