My directory is as such:
├Script.js
|
├public/
| └...
└src/
└ App.js
and inside App.js I’m trying to invoke the Script.js
as such:
import calculations from './../Script'
...
onclick={()=>{calculations()}}
Script.js:
const calculations=()=>{...}
export default calculations;
but obviously it won’t work, so how do I run a script on the server?
do I make a post request to the server? If so, how do I handle it? (like in express app.post()
)