Browse Source

Merge remote-tracking branch 'github/master' into lcs2dev

Nikolay Suslov 6 years ago
parent
commit
c2d8319163
2 changed files with 3 additions and 2 deletions
  1. 1 1
      README.md
  2. 2 1
      index.js

+ 1 - 1
README.md

@@ -35,4 +35,4 @@ alongside with the existed features from the initial version ```v0.1```:
 <img src="https://krestianstvo.org/lib/images/doc/images/osc.jpg" width="400">
 <br>
 <img src="https://krestianstvo.org/lib/images/doc/images/avatar.jpg" width="400">
-<br>
+<br>

+ 2 - 1
index.js

@@ -41,7 +41,8 @@ function readDirR(dir) {
     } else {
       if ((dir.indexOf('.yaml') !== -1) || (dir.indexOf('.js') !== -1) || (dir.indexOf('.html') !== -1)
       || (dir.indexOf('.json') !== -1))
-       return dir.replace(__dirname + '/public/', "/")
+       // a little hack to resolve serving file paths under PC/Windows file system...
+       return dir.replace(__dirname, '').replace(/\\/g, '/').replace('/public/',"/");
     }
 }