pimp up workbench-web.html

This commit is contained in:
João Moreno
2021-03-19 15:23:15 +01:00
parent 163aeeedac
commit ede3632a56
2 changed files with 24 additions and 5 deletions

View File

@@ -226,12 +226,14 @@ const requestHandler = (req, res) => {
const parsedUrl = url.parse(req.url, true);
const pathname = parsedUrl.pathname;
res.setHeader('Access-Control-Allow-Origin', '*');
try {
if (pathname === '/favicon.ico') {
if (/(\/static)?\/favicon\.ico/.test(pathname)) {
// favicon
return serveFile(req, res, path.join(APP_ROOT, 'resources', 'win32', 'code.ico'));
}
if (pathname === '/manifest.json') {
if (/(\/static)?\/manifest\.json/.test(pathname)) {
// manifest
res.writeHead(200, { 'Content-Type': 'application/json' });
return res.end(JSON.stringify({