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.
@@ -385,11 +385,11 @@ async function webCommand(options) {
385
385
  });
386
386
 
387
387
  // Frontend routes
388
- const logoPath = path.resolve(__dirname, '../../assets/logo.svg');
389
- const gitgraphPath = path.join(__dirname, '../web/gitgraph.js');
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(logoPath, error => {
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
- try {
409
- res.sendFile(gitgraphPath);
410
- } catch (e) {
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glad-web",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "Glad transforms terminal-based AI coding tools into a polished, mobile-friendly local Web interface.",
5
5
  "main": "index.js",
6
6
  "bin": {