I have an express server running that sends an html file from the public folder of my project. It is from a client script linked from this html file that I am trying to request and send data to the server. I have looked just about everywhere and have had no luck finding a way to do this. I thought that it could be done just using express but I cannot seem to figure it out. I feel like I must be missing or misunderstanding something obvious. How can I do this?
|--index.js
|--template.json
|--public
| |--index.html
| |--client.js
1: Here is my file structure. I am trying to have client.js send a request to index.js which then will respond with some json.
Any solutions or even just pointers are appreciated.