[Idea] Add some env var
Closed this issue · 3 comments
The goal it's get get a better customisation without have recalbox branch for logo etc...
So it will be more easely to maintain this project.
It's easy to see that port
can be set as ENV VAR. But how about the logo?
To have the logo configurable you would either need to load the image from the internet and configure the URL or you would have to build the html dynamically which is inefficient. How do you plan on solving this?
That is the question ^^.
How I see it (for logo):
- Add custom svg on images/
- Use express renderer instead of static page, like :
app.get('/', function(req, res) {
res.render('index', {controllerSvg: process.env.NEW_PATH || default.svg});
});
We can also add more config var in config.json.
New idea: how a bout rendering the template once at startup and save it as static html file and serve that instead of rendering it for each request. Maybe node also incorporates some caching functionality in rendering templates—that would make my suggested step unnecessary.