I am trying to build an electron app with a server component using express for remote control.
The express module initializes with
var staticPath = path.resolve('app/assets')
setupNotifications(server);
app.use(cors());
app.use('/api/', json());
app.use('/api/', router);
app.use('/assets', express.static(staticPath));
console.log('serving static files from : ' + staticPath);
the Elecron docs mention that the current working directory cannot be set to a folder in the asar archive. This is confirmed by the error message indicates the file is being tried to be read from 'app/assets' below the root folder of the installation.
How can I tell express to read the files from the ASAR archive? And how can I do this so that I can develop with an 'exploded' archive and deploy with a built archive?