hdoc-tools 0.7.17 → 0.7.18
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/hdoc-serve.js +5 -3
- package/package.json +1 -1
package/hdoc-serve.js
CHANGED
|
@@ -217,7 +217,6 @@
|
|
|
217
217
|
let url = req.url;
|
|
218
218
|
|
|
219
219
|
let segs = url.split('/');
|
|
220
|
-
|
|
221
220
|
if (segs.length == 4 && segs[1] == '_books' && segs[3] == 'book.json') {
|
|
222
221
|
// Special case of a virtual file here, we need to check the book ID and
|
|
223
222
|
// if its our book, send the json
|
|
@@ -251,8 +250,11 @@
|
|
|
251
250
|
return;
|
|
252
251
|
}
|
|
253
252
|
|
|
254
|
-
url =
|
|
255
|
-
|
|
253
|
+
url = '';
|
|
254
|
+
segs.forEach(function(urlSeg){
|
|
255
|
+
if (urlSeg !== '' && urlSeg !== '_books') url += '/' + urlSeg;
|
|
256
|
+
});
|
|
257
|
+
|
|
256
258
|
console.log('URL Requested:', url);
|
|
257
259
|
|
|
258
260
|
let file_path = path.join(source_path, url);
|