So this does two things. The module files don't get served with the server because there built in a different directory.
Then there seems to be a CORS problem. I'm guessing because the ide has a origin of https://www.espruino.com and the express server just rejects it. So i just set it to allow anyone to receive the file.
Fixes this error
Access to fetch at 'http://localhost:3040/modules/BH1792.min.js' from
origin 'https://www.espruino.com' has been blocked by CORS policy: No
'Access-Control-Allow-Origin' header is present on the requested
resource. If an opaque response serves your needs, set the request's
mode to 'no-cors' to fetch the resource with CORS disabled.
So this does two things. The module files don't get served with the server because there built in a different directory.
Then there seems to be a CORS problem. I'm guessing because the ide has a origin of https://www.espruino.com and the express server just rejects it. So i just set it to allow anyone to receive the file.
Fixes this error Access to fetch at 'http://localhost:3040/modules/BH1792.min.js' from origin 'https://www.espruino.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.