hdoc-tools 0.7.8 → 0.7.9
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 +8 -21
- package/package.json +1 -1
- package/LICENSE +0 -21
package/hdoc-serve.js
CHANGED
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
|
|
113
113
|
function expand_variables(text) {
|
|
114
114
|
// For debug mode our base path is our root??
|
|
115
|
-
text = text.replaceAll('{{
|
|
115
|
+
text = text.replaceAll('{{DOC_ID}}', docId);
|
|
116
116
|
text = text.replaceAll('{{BUILD_NUMBER}}', '0');
|
|
117
117
|
|
|
118
118
|
let build_date = new Date().toISOString();
|
|
@@ -329,26 +329,6 @@
|
|
|
329
329
|
// Catch all
|
|
330
330
|
app.get('/*', function (req, res) {
|
|
331
331
|
|
|
332
|
-
let segs = req.url.split('/');
|
|
333
|
-
|
|
334
|
-
if (segs.length > 3 && segs[2] == 'content') {
|
|
335
|
-
// In this case we are looking for static content within the book
|
|
336
|
-
|
|
337
|
-
// Create the file path
|
|
338
|
-
let url = req.url.replace('/content/', '/');
|
|
339
|
-
let file_path = path.join(source_path, url);
|
|
340
|
-
|
|
341
|
-
// If the file exists, send it.
|
|
342
|
-
if (fs.existsSync(file_path) == true) {
|
|
343
|
-
send_file(req, res, file_path);
|
|
344
|
-
return;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
// All else fails, we have not file to return, so return a 404 error here
|
|
348
|
-
send_content_resource_404(req, res);
|
|
349
|
-
return;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
332
|
let ui_file_path = path.join(ui_path, req.url);
|
|
353
333
|
|
|
354
334
|
console.log('URL Root:', req.url);
|
|
@@ -376,6 +356,13 @@
|
|
|
376
356
|
|
|
377
357
|
console.log('Server listening at http://127.0.0.1:%s', port);
|
|
378
358
|
console.log('Document source path is: ' + source_path);
|
|
359
|
+
|
|
360
|
+
let _vars = ['{{DOC_ID}}', '{{BASE_PATH}}', '{{BUILD_NUMBER}}', '{{BUILD_DATE}}'];
|
|
361
|
+
console.log("Server Vars:");
|
|
362
|
+
for(let x = 0; x < _vars.length; x++) {
|
|
363
|
+
let name = _vars[x];
|
|
364
|
+
console.log(" ", name, " = ", expand_variables(name));
|
|
365
|
+
}
|
|
379
366
|
});
|
|
380
367
|
|
|
381
368
|
};
|
package/package.json
CHANGED
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2022 Hornbill Docs
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|