I'm working on a little passion project, and until now most of my js work has been client-side. I'm starting to delve into some server-side work now, but I'm a little lost at the moment.
Basically, I have a two-fold question.
<form action="/receive" method="post">
<button class="btn btn-primary results-share-results" data-bs-dismiss="modal">
</form>
Very generally, how would I take a form like this one above and receive its POST request in a node.js program? I think my main hangup is like "where" this POST request is going. What am I pointing it to? And what in the node program is receiving it?
More specifically to my project, I'd like that button to trigger a POST that sends data I have stored in an object to a node script. This script would receive this data and then write it either to a JSON file or to a database (I'm not quite at the database level yet, so a JSON file will do for now).
Thank you in advance!
Honestly, I've mostly fumbled through some YouTube videos. I can understand how a POST/GET request works to an API, but I'm struggling to understand how the calls work to a local file or to a database.