Can you test a module from a local EspruinoDocs server #1683
Replies: 6 comments
-
Posted at 2024-01-02 by @gfwilliams If the Web IDE's library search path includes the folder then I'd have thought it should be able to find it just fine? It might be worth checking the debug console on your web browser - maybe the web server created by |
Beta Was this translation helpful? Give feedback.
-
Posted at 2024-01-13 by user156811 So i think the problem i'm having is this. But when i do http://localhost:3040/modules - i get
As for the debug console. I don't see any errors.
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2024-01-13 by user156811 So this is my current understanding app.js is the way the websites served. It serves the content inside EspruinoDocs/html. This file includes all the files that got generated from the markdown modules. Now the the javascript modules are in. So they they never get served up from the server. #buildmodules.sh
DIR=`pwd`
WEBSITE="$HOME/workspace/espruinowebsite"
MODULEDIR=$WEBSITE/www/modules So i changed the location DIR=`pwd`
WEBSITE="$DIR/html"
MODULEDIR=$WEBSITE/modules and now the ide will grab the files it just doesn't use it? So i can see from the server it serves the files. but from the ide perspective i still get. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2024-01-13 by user156811 Sorry my bad! When you suggested look at the web ide. I thought you were talking about on the actual web page. So module.html.. I saved the espruino app to my desktop, so i forget it's actually a web page. So yes the problem is that in chrome it doesn't accept none secure local host files. The specific problem.
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2024-01-13 by user156811 So it was a fairly easy fix to stop the CORS problem. var express = require('express');
const cors = require('cors');
var app = express();
app.use(cors()); If i understand this properly this app.js is just testing. So if that's the case. I can push this simple fix and redirect anything that's trying to load a file from localhost:3040/modules to ~/workspace/espruinowebsite/www/modules |
Beta Was this translation helpful? Give feedback.
-
Posted at 2024-01-15 by @gfwilliams This looks great, thanks for the PR! I guess the redirect to |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2023-12-21 by user156811
So i have a module that i've made.
I've tested it locally by saving it to a file on the device i'm working on and it works fine. I've also pulled the EspruinoDocs and compiled it to make sure that the documentation looks fine.
Now can i do one final test where i load it from my local EpsruinoDocs instance.
I run npm run start after doing a build.sh and i can see my webpage of my new module. But i can't seem to see it in the browser or from the device.
I set the module loading location to http://localhost:3040/devices
Any thoughts
Beta Was this translation helpful? Give feedback.
All reactions