fdb2 1.0.19 → 1.0.21

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/server.js +3 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fdb2",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "private": false,
5
5
  "type": "commonjs",
6
6
  "main": "view/index.html",
package/server.js CHANGED
@@ -96,14 +96,14 @@ app.use('/api/', async (req, res, next) => {
96
96
  });
97
97
 
98
98
  // 配置静态文件目录 - 只有 /public 请求指向 public 目录
99
- app.use('/public', express.static(path.join(staticDir, 'public')));
99
+ app.use('/public', express.static(path.join(staticDir, 'public'), { dotfiles: 'allow' }));
100
100
 
101
101
  // 所有未匹配的路由都指向 index.html
102
102
  app.use((req, res) => {
103
103
  const indexPath = path.join(staticDir, 'view', 'index.html');
104
- res.sendFile(indexPath, (err) => {
104
+ res.sendFile(indexPath, { dotfiles: 'allow' }, (err) => {
105
105
  if (err) {
106
- res.status(500).send('Error loading index.html');
106
+ res.status(500).send('Error loading index.html:' + err.toString());
107
107
  }
108
108
  });
109
109
  });