소스 검색

Merge pull request #2 from lazydino/reggie

Worked with PC/Windows file path
Nikolay Suslov 5 년 전
부모
커밋
1c8fa1b3ed
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      index.js

+ 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/',"/");
     }
 }