Read the statement by Michael Teeuw here.
Loading parts of config from external json file
-
Hello,
I’m planning on making a smart mirror and making an external app to control my mirror as a hobby project and I want to edit parts of the config using it. So I started experimenting with loading from an external json file and saw that I could load port for the application just fine from the json.
I then tried to load the feeds for the newsfeed module from the json and the application starts but just shows a black screen. No errors in the console, config:check passes, I even console.logged the config and it was in the correct format.
Does anyone have any experience with loading config from external file or does anyone know what could cause the black screen?
-
@melonlord u can’t load from external file.
it loads in browser, which doesn’t allow file I/o
u might want to looks at my MMM-Config app
which presents a form to manage config from any web browser phone, tablet , laptop or desktop
-
@sdetweil shame about that.
While what you have is nice, it’s not exactly what I’m looking for. I guess I’ll have to look into some other smart mirror platforms.
Thanks
-
@melonlord about the only thing that would work is to create another file with your ‘includes’
and preprocess it to generate the config.js
add another step to the mm.sh before npm start -
@sdetweil the preprocessor idea is actually pretty good!
From initial testing it seems to work! There is still hope :D
-
@melonlord u could also fix the package.json start command to run a script, or chain the command, so that not starting with mm.sh would still work. move the preprocess step out of mm.sh