I am setting up a webhook receiver just to learn the ropes. I have run a number of tests that work fine with node. Now I am attempting to put this receiver on a publicly hosted page so that I don't have to keep my personal computer on at all times. But when I open the file in browser I get the error Uncaught ReferenceError: require is not defined
. If I just change the "require" lines to "import" will that fix the problem?
Separately, if 'require' can't be used in browser, when is it appropriate and when should I just avoid using it from the start?
I have tried esbuild but that gave me a whole new set of errors and I am wondering if there is a more efficient solution before I go further down that path?