I am trying to send data from my express server to the client side.
I have used app.post and app.get, the problem i'm having is that with either of those, the request must come from the client side. I need to send to push the data from the server side once a script has run has finished.
What i am doing is:
- Client inputs data on client side
- Data is send to the server using app.post api
- Server runs script
- Server sends data back to client side
you probably looking for ejs engine. it allows you to send data from the server to the client. all you have to do is replace .html to .ejs for example: index.html will be index.ejs and you will have to add the engine in to your server as a middlware. just search about ejs