glad-web 1.0.10 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commands/web.js +6 -8
- package/package.json +1 -1
package/lib/commands/web.js
CHANGED
|
@@ -385,11 +385,11 @@ async function webCommand(options) {
|
|
|
385
385
|
});
|
|
386
386
|
|
|
387
387
|
// Frontend routes
|
|
388
|
-
const
|
|
389
|
-
const
|
|
388
|
+
const assetsDir = path.resolve(__dirname, '../../assets');
|
|
389
|
+
const webDir = path.join(__dirname, '../web');
|
|
390
390
|
|
|
391
391
|
const sendLogo = (req, res) => {
|
|
392
|
-
res.sendFile(
|
|
392
|
+
res.sendFile('logo.svg', { root: assetsDir }, error => {
|
|
393
393
|
if (error && !res.headersSent) res.status(404).send('Not found');
|
|
394
394
|
});
|
|
395
395
|
};
|
|
@@ -405,11 +405,9 @@ async function webCommand(options) {
|
|
|
405
405
|
});
|
|
406
406
|
|
|
407
407
|
app.get(['/gitgraph.js', /.*\/gitgraph\.js$/], (req, res) => {
|
|
408
|
-
|
|
409
|
-
res.
|
|
410
|
-
}
|
|
411
|
-
res.status(404).send('Not found');
|
|
412
|
-
}
|
|
408
|
+
res.sendFile('gitgraph.js', { root: webDir }, error => {
|
|
409
|
+
if (error && !res.headersSent) res.status(404).send('Not found');
|
|
410
|
+
});
|
|
413
411
|
});
|
|
414
412
|
|
|
415
413
|
app.get(['/logo.svg', /.*\/logo\.svg$/], sendLogo);
|