kempo-server 2.2.0 → 3.0.1
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/CONFIG.md +295 -187
- package/README.md +5 -4
- package/SPA.md +14 -14
- package/dist/defaultConfig.js +1 -1
- package/dist/index.js +1 -1
- package/dist/render.js +2 -0
- package/dist/router.js +1 -1
- package/dist/serveFile.js +1 -1
- package/dist/templating/index.js +1 -0
- package/dist/templating/parse.js +1 -0
- package/docs/caching.html +103 -17
- package/docs/cli-utils.html +102 -16
- package/docs/configuration.html +104 -17
- package/docs/examples.html +104 -17
- package/docs/fs-utils.html +102 -16
- package/docs/getting-started.html +104 -17
- package/docs/index.html +176 -81
- package/docs/middleware.html +104 -17
- package/docs/request-response.html +104 -17
- package/docs/routing.html +104 -17
- package/docs/templating.html +292 -0
- package/docs-src/.config.js +11 -0
- package/docs-src/caching.page.html +220 -0
- package/docs-src/cli-utils.page.html +71 -0
- package/docs-src/configuration.page.html +310 -0
- package/docs-src/default.template.html +35 -0
- package/docs-src/examples.page.html +192 -0
- package/docs-src/fs-utils.page.html +102 -0
- package/docs-src/getting-started.page.html +63 -0
- package/docs-src/index.page.html +79 -0
- package/docs-src/middleware.page.html +133 -0
- package/docs-src/nav.fragment.html +73 -0
- package/docs-src/request-response.page.html +96 -0
- package/docs-src/routing.page.html +73 -0
- package/docs-src/templating.page.html +188 -0
- package/llms.txt +97 -31
- package/package.json +5 -2
- package/scripts/build.js +22 -1
- package/scripts/render.js +58 -0
- package/src/defaultConfig.js +14 -2
- package/src/index.js +1 -1
- package/src/router.js +69 -10
- package/src/serveFile.js +27 -0
- package/src/templating/index.js +132 -0
- package/src/templating/parse.js +285 -0
- package/tests/cacheConfig.node-test.js +2 -2
- package/tests/config-flag.node-test.js +61 -25
- package/tests/customRoute-outside-root.node-test.js +1 -1
- package/tests/router-wildcard.node-test.js +47 -2
- package/tests/templating-parse.node-test.js +243 -0
- package/tests/templating-render.node-test.js +188 -0
- package/tests/utils/test-scenario.js +4 -4
- package/docs/.config.json.example +0 -29
- package/docs/api/_admin/cache/DELETE.js +0 -28
- package/docs/api/_admin/cache/GET.js +0 -53
- package/docs/api/user/[id]/GET.js +0 -15
- package/docs/api/user/[id]/[info]/DELETE.js +0 -12
- package/docs/api/user/[id]/[info]/GET.js +0 -17
- package/docs/api/user/[id]/[info]/POST.js +0 -18
- package/docs/api/user/[id]/[info]/PUT.js +0 -19
- package/docs/init.js +0 -2
- package/docs/nav.inc.html +0 -70
package/docs/configuration.html
CHANGED
|
@@ -1,19 +1,102 @@
|
|
|
1
|
-
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
2
3
|
<head>
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta
|
|
6
|
+
name="viewport"
|
|
7
|
+
content="width=device-width, initial-scale=1.0"
|
|
8
|
+
/>
|
|
9
|
+
<title>Configuration - Kempo Server</title>
|
|
10
|
+
<link rel="icon" type="image/svg+xml" href="./media/icon.svg" />
|
|
11
|
+
<link rel="icon" type="image/png" sizes="32x32" href="./media/icon32.png" />
|
|
12
|
+
<link rel="manifest" href="./manifest.json" />
|
|
13
|
+
<link
|
|
14
|
+
rel="stylesheet"
|
|
15
|
+
href="https://cdn.jsdelivr.net/npm/kempo-css@2/dist/kempo.min.css"
|
|
16
|
+
/>
|
|
17
|
+
<link rel="stylesheet" href="./theme.css" />
|
|
18
|
+
<script>
|
|
19
|
+
window.litDisableBundleWarning = true;
|
|
20
|
+
window.kempo = { pathsToIcons: ['https://cdn.jsdelivr.net/npm/kempo-ui@0.0.42/icons/'] };
|
|
21
|
+
</script>
|
|
12
22
|
</head>
|
|
13
23
|
<body>
|
|
14
|
-
|
|
15
|
-
<k-
|
|
16
|
-
|
|
24
|
+
|
|
25
|
+
<k-nav
|
|
26
|
+
fixed
|
|
27
|
+
class="bg-primary"
|
|
28
|
+
>
|
|
29
|
+
<button
|
|
30
|
+
id="toggleNavSideMenu"
|
|
31
|
+
class="link"
|
|
32
|
+
>
|
|
33
|
+
<k-icon name="menu"></k-icon>
|
|
34
|
+
</button>
|
|
35
|
+
<a
|
|
36
|
+
href="./"
|
|
37
|
+
class="d-if ph"
|
|
38
|
+
style="align-items: center"
|
|
39
|
+
>
|
|
40
|
+
<img src="./media/icon32.png" alt="Kempo Server Icon" class="pr" />
|
|
41
|
+
Kempo Server
|
|
42
|
+
</a>
|
|
43
|
+
<div class="flex"></div>
|
|
44
|
+
<a href="https://github.com/dustinpoissant/kempo-ui?tab=License-1-ov-file#creative-commons-attribution-noncommercial-sharealike-20" target="_blank"><k-icon name="license"></k-icont></a>
|
|
45
|
+
<a href="https://github.com/dustinpoissant/kempo-ui" target="_blank"><k-icon name="github-mark"></k-icont></a>
|
|
46
|
+
<k-theme-switcher></k-theme-switcher>
|
|
47
|
+
</k-nav>
|
|
48
|
+
<div style="width: 100%; height: 4rem;"></div>
|
|
49
|
+
<k-aside
|
|
50
|
+
id="navSideMenu"
|
|
51
|
+
state="offscreen"
|
|
52
|
+
>
|
|
53
|
+
<menu>
|
|
54
|
+
<a href="./" class="ta-center bb mb r0">
|
|
55
|
+
<h1 class="tc-primary">Kempo Server</h1>
|
|
56
|
+
<img src="./media/icon128.png" alt="Kempo UI Icon" />
|
|
57
|
+
</a>
|
|
58
|
+
<h3>Getting Started</h3>
|
|
59
|
+
<a href="./" class="d-b pq pl">Quick Start</a>
|
|
60
|
+
<a href="./routing.html" class="d-b pq pl">Routing</a>
|
|
61
|
+
<a href="./request-response.html" class="d-b pq pl">Request & Response</a>
|
|
62
|
+
<br /><br />
|
|
63
|
+
<h3>Advanced Features</h3>
|
|
64
|
+
<a href="configuration.html" class="d-b pq pl">Configuration</a>
|
|
65
|
+
<a href="templating.html" class="d-b pq pl">Templating</a>
|
|
66
|
+
<a href="middleware.html" class="d-b pq pl">Middleware</a>
|
|
67
|
+
<a href="caching.html" class="d-b pq pl">Module Caching</a>
|
|
68
|
+
<a href="cli-utils.html" class="d-b pq pl">CLI Utilities</a>
|
|
69
|
+
<a href="fs-utils.html" class="d-b pq pl">File System Utilities</a>
|
|
70
|
+
<a href="examples.html" class="d-b pq pl">Examples & Demos</a>
|
|
71
|
+
</menu>
|
|
72
|
+
</k-aside>
|
|
73
|
+
<script src="https://cdn.jsdelivr.net/npm/kempo-ui@0.3.5/src/components/Aside.js" type="module"></script>
|
|
74
|
+
<script src="https://cdn.jsdelivr.net/npm/kempo-ui@0.3.5/src/components/Main.js" type="module"></script>
|
|
75
|
+
<script src="https://cdn.jsdelivr.net/npm/kempo-ui@0.3.5/src/components/Nav.js" type="module"></script>
|
|
76
|
+
<script src="https://cdn.jsdelivr.net/npm/kempo-ui@0.3.5/src/components/Icon.js" type="module"></script>
|
|
77
|
+
<script src="https://cdn.jsdelivr.net/npm/kempo-ui@0.3.5/src/components/ThemeSwitcher.js" type="module"></script>
|
|
78
|
+
<script>
|
|
79
|
+
document.getElementById('toggleNavSideMenu').addEventListener('click', async () => {
|
|
80
|
+
await window.customElements.whenDefined('k-aside');
|
|
81
|
+
document.getElementById('navSideMenu').toggle();
|
|
82
|
+
});
|
|
83
|
+
document.addEventListener('click', function(e) {
|
|
84
|
+
if (e.target.matches('a[href^="#"]')) {
|
|
85
|
+
e.preventDefault();
|
|
86
|
+
const targetId = e.target.getAttribute('href').replace('#', '');
|
|
87
|
+
const target = document.getElementById(targetId);
|
|
88
|
+
if (target) {
|
|
89
|
+
target.scrollIntoView({ behavior: 'smooth' });
|
|
90
|
+
const url = window.location.pathname + window.location.search + '#' + targetId;
|
|
91
|
+
history.replaceState(null, '', url);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
</script>
|
|
96
|
+
|
|
97
|
+
<main>
|
|
98
|
+
<h1 class="ta-center">Configuration</h1>
|
|
99
|
+
|
|
17
100
|
<p>Customize Kempo Server's behavior with a simple JSON configuration file.</p>
|
|
18
101
|
|
|
19
102
|
<h2>Configuration File</h2>
|
|
@@ -320,8 +403,12 @@
|
|
|
320
403
|
<li>Enable file watching in development, disable in production for stability</li>
|
|
321
404
|
<li>Use shorter TTL in development for faster iteration</li>
|
|
322
405
|
</ul>
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
406
|
+
|
|
407
|
+
</main>
|
|
408
|
+
<div style="height:25vh"></div>
|
|
409
|
+
<script
|
|
410
|
+
type="module"
|
|
411
|
+
src="https://cdn.jsdelivr.net/npm/kempo-ui@0.0.42/dist/components/Import.js"
|
|
412
|
+
></script>
|
|
326
413
|
</body>
|
|
327
|
-
</html>
|
|
414
|
+
</html>
|
package/docs/examples.html
CHANGED
|
@@ -1,19 +1,102 @@
|
|
|
1
|
-
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
2
3
|
<head>
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta
|
|
6
|
+
name="viewport"
|
|
7
|
+
content="width=device-width, initial-scale=1.0"
|
|
8
|
+
/>
|
|
9
|
+
<title>Examples & Demos - Kempo Server</title>
|
|
10
|
+
<link rel="icon" type="image/svg+xml" href="./media/icon.svg" />
|
|
11
|
+
<link rel="icon" type="image/png" sizes="32x32" href="./media/icon32.png" />
|
|
12
|
+
<link rel="manifest" href="./manifest.json" />
|
|
13
|
+
<link
|
|
14
|
+
rel="stylesheet"
|
|
15
|
+
href="https://cdn.jsdelivr.net/npm/kempo-css@2/dist/kempo.min.css"
|
|
16
|
+
/>
|
|
17
|
+
<link rel="stylesheet" href="./theme.css" />
|
|
18
|
+
<script>
|
|
19
|
+
window.litDisableBundleWarning = true;
|
|
20
|
+
window.kempo = { pathsToIcons: ['https://cdn.jsdelivr.net/npm/kempo-ui@0.0.42/icons/'] };
|
|
21
|
+
</script>
|
|
12
22
|
</head>
|
|
13
23
|
<body>
|
|
14
|
-
|
|
15
|
-
<k-
|
|
16
|
-
|
|
24
|
+
|
|
25
|
+
<k-nav
|
|
26
|
+
fixed
|
|
27
|
+
class="bg-primary"
|
|
28
|
+
>
|
|
29
|
+
<button
|
|
30
|
+
id="toggleNavSideMenu"
|
|
31
|
+
class="link"
|
|
32
|
+
>
|
|
33
|
+
<k-icon name="menu"></k-icon>
|
|
34
|
+
</button>
|
|
35
|
+
<a
|
|
36
|
+
href="./"
|
|
37
|
+
class="d-if ph"
|
|
38
|
+
style="align-items: center"
|
|
39
|
+
>
|
|
40
|
+
<img src="./media/icon32.png" alt="Kempo Server Icon" class="pr" />
|
|
41
|
+
Kempo Server
|
|
42
|
+
</a>
|
|
43
|
+
<div class="flex"></div>
|
|
44
|
+
<a href="https://github.com/dustinpoissant/kempo-ui?tab=License-1-ov-file#creative-commons-attribution-noncommercial-sharealike-20" target="_blank"><k-icon name="license"></k-icont></a>
|
|
45
|
+
<a href="https://github.com/dustinpoissant/kempo-ui" target="_blank"><k-icon name="github-mark"></k-icont></a>
|
|
46
|
+
<k-theme-switcher></k-theme-switcher>
|
|
47
|
+
</k-nav>
|
|
48
|
+
<div style="width: 100%; height: 4rem;"></div>
|
|
49
|
+
<k-aside
|
|
50
|
+
id="navSideMenu"
|
|
51
|
+
state="offscreen"
|
|
52
|
+
>
|
|
53
|
+
<menu>
|
|
54
|
+
<a href="./" class="ta-center bb mb r0">
|
|
55
|
+
<h1 class="tc-primary">Kempo Server</h1>
|
|
56
|
+
<img src="./media/icon128.png" alt="Kempo UI Icon" />
|
|
57
|
+
</a>
|
|
58
|
+
<h3>Getting Started</h3>
|
|
59
|
+
<a href="./" class="d-b pq pl">Quick Start</a>
|
|
60
|
+
<a href="./routing.html" class="d-b pq pl">Routing</a>
|
|
61
|
+
<a href="./request-response.html" class="d-b pq pl">Request & Response</a>
|
|
62
|
+
<br /><br />
|
|
63
|
+
<h3>Advanced Features</h3>
|
|
64
|
+
<a href="configuration.html" class="d-b pq pl">Configuration</a>
|
|
65
|
+
<a href="templating.html" class="d-b pq pl">Templating</a>
|
|
66
|
+
<a href="middleware.html" class="d-b pq pl">Middleware</a>
|
|
67
|
+
<a href="caching.html" class="d-b pq pl">Module Caching</a>
|
|
68
|
+
<a href="cli-utils.html" class="d-b pq pl">CLI Utilities</a>
|
|
69
|
+
<a href="fs-utils.html" class="d-b pq pl">File System Utilities</a>
|
|
70
|
+
<a href="examples.html" class="d-b pq pl">Examples & Demos</a>
|
|
71
|
+
</menu>
|
|
72
|
+
</k-aside>
|
|
73
|
+
<script src="https://cdn.jsdelivr.net/npm/kempo-ui@0.3.5/src/components/Aside.js" type="module"></script>
|
|
74
|
+
<script src="https://cdn.jsdelivr.net/npm/kempo-ui@0.3.5/src/components/Main.js" type="module"></script>
|
|
75
|
+
<script src="https://cdn.jsdelivr.net/npm/kempo-ui@0.3.5/src/components/Nav.js" type="module"></script>
|
|
76
|
+
<script src="https://cdn.jsdelivr.net/npm/kempo-ui@0.3.5/src/components/Icon.js" type="module"></script>
|
|
77
|
+
<script src="https://cdn.jsdelivr.net/npm/kempo-ui@0.3.5/src/components/ThemeSwitcher.js" type="module"></script>
|
|
78
|
+
<script>
|
|
79
|
+
document.getElementById('toggleNavSideMenu').addEventListener('click', async () => {
|
|
80
|
+
await window.customElements.whenDefined('k-aside');
|
|
81
|
+
document.getElementById('navSideMenu').toggle();
|
|
82
|
+
});
|
|
83
|
+
document.addEventListener('click', function(e) {
|
|
84
|
+
if (e.target.matches('a[href^="#"]')) {
|
|
85
|
+
e.preventDefault();
|
|
86
|
+
const targetId = e.target.getAttribute('href').replace('#', '');
|
|
87
|
+
const target = document.getElementById(targetId);
|
|
88
|
+
if (target) {
|
|
89
|
+
target.scrollIntoView({ behavior: 'smooth' });
|
|
90
|
+
const url = window.location.pathname + window.location.search + '#' + targetId;
|
|
91
|
+
history.replaceState(null, '', url);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
</script>
|
|
96
|
+
|
|
97
|
+
<main>
|
|
98
|
+
<h1 class="ta-center">Examples & Demos</h1>
|
|
99
|
+
|
|
17
100
|
<p>Explore practical examples and try interactive demos of Kempo Server features.</p>
|
|
18
101
|
|
|
19
102
|
<h2>Code Examples</h2>
|
|
@@ -202,8 +285,12 @@
|
|
|
202
285
|
}
|
|
203
286
|
}
|
|
204
287
|
</script>
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
288
|
+
|
|
289
|
+
</main>
|
|
290
|
+
<div style="height:25vh"></div>
|
|
291
|
+
<script
|
|
292
|
+
type="module"
|
|
293
|
+
src="https://cdn.jsdelivr.net/npm/kempo-ui@0.0.42/dist/components/Import.js"
|
|
294
|
+
></script>
|
|
208
295
|
</body>
|
|
209
|
-
</html>
|
|
296
|
+
</html>
|
package/docs/fs-utils.html
CHANGED
|
@@ -1,20 +1,102 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
|
-
<html lang="en"
|
|
2
|
+
<html lang="en">
|
|
3
3
|
<head>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta
|
|
6
|
+
name="viewport"
|
|
7
|
+
content="width=device-width, initial-scale=1.0"
|
|
8
|
+
/>
|
|
9
|
+
<title>File System Utilities - Kempo Server</title>
|
|
10
|
+
<link rel="icon" type="image/svg+xml" href="./media/icon.svg" />
|
|
11
|
+
<link rel="icon" type="image/png" sizes="32x32" href="./media/icon32.png" />
|
|
12
|
+
<link rel="manifest" href="./manifest.json" />
|
|
13
|
+
<link
|
|
14
|
+
rel="stylesheet"
|
|
15
|
+
href="https://cdn.jsdelivr.net/npm/kempo-css@2/dist/kempo.min.css"
|
|
16
|
+
/>
|
|
17
|
+
<link rel="stylesheet" href="./theme.css" />
|
|
18
|
+
<script>
|
|
19
|
+
window.litDisableBundleWarning = true;
|
|
20
|
+
window.kempo = { pathsToIcons: ['https://cdn.jsdelivr.net/npm/kempo-ui@0.0.42/icons/'] };
|
|
21
|
+
</script>
|
|
13
22
|
</head>
|
|
14
23
|
<body>
|
|
15
|
-
|
|
16
|
-
<k-
|
|
17
|
-
|
|
24
|
+
|
|
25
|
+
<k-nav
|
|
26
|
+
fixed
|
|
27
|
+
class="bg-primary"
|
|
28
|
+
>
|
|
29
|
+
<button
|
|
30
|
+
id="toggleNavSideMenu"
|
|
31
|
+
class="link"
|
|
32
|
+
>
|
|
33
|
+
<k-icon name="menu"></k-icon>
|
|
34
|
+
</button>
|
|
35
|
+
<a
|
|
36
|
+
href="./"
|
|
37
|
+
class="d-if ph"
|
|
38
|
+
style="align-items: center"
|
|
39
|
+
>
|
|
40
|
+
<img src="./media/icon32.png" alt="Kempo Server Icon" class="pr" />
|
|
41
|
+
Kempo Server
|
|
42
|
+
</a>
|
|
43
|
+
<div class="flex"></div>
|
|
44
|
+
<a href="https://github.com/dustinpoissant/kempo-ui?tab=License-1-ov-file#creative-commons-attribution-noncommercial-sharealike-20" target="_blank"><k-icon name="license"></k-icont></a>
|
|
45
|
+
<a href="https://github.com/dustinpoissant/kempo-ui" target="_blank"><k-icon name="github-mark"></k-icont></a>
|
|
46
|
+
<k-theme-switcher></k-theme-switcher>
|
|
47
|
+
</k-nav>
|
|
48
|
+
<div style="width: 100%; height: 4rem;"></div>
|
|
49
|
+
<k-aside
|
|
50
|
+
id="navSideMenu"
|
|
51
|
+
state="offscreen"
|
|
52
|
+
>
|
|
53
|
+
<menu>
|
|
54
|
+
<a href="./" class="ta-center bb mb r0">
|
|
55
|
+
<h1 class="tc-primary">Kempo Server</h1>
|
|
56
|
+
<img src="./media/icon128.png" alt="Kempo UI Icon" />
|
|
57
|
+
</a>
|
|
58
|
+
<h3>Getting Started</h3>
|
|
59
|
+
<a href="./" class="d-b pq pl">Quick Start</a>
|
|
60
|
+
<a href="./routing.html" class="d-b pq pl">Routing</a>
|
|
61
|
+
<a href="./request-response.html" class="d-b pq pl">Request & Response</a>
|
|
62
|
+
<br /><br />
|
|
63
|
+
<h3>Advanced Features</h3>
|
|
64
|
+
<a href="configuration.html" class="d-b pq pl">Configuration</a>
|
|
65
|
+
<a href="templating.html" class="d-b pq pl">Templating</a>
|
|
66
|
+
<a href="middleware.html" class="d-b pq pl">Middleware</a>
|
|
67
|
+
<a href="caching.html" class="d-b pq pl">Module Caching</a>
|
|
68
|
+
<a href="cli-utils.html" class="d-b pq pl">CLI Utilities</a>
|
|
69
|
+
<a href="fs-utils.html" class="d-b pq pl">File System Utilities</a>
|
|
70
|
+
<a href="examples.html" class="d-b pq pl">Examples & Demos</a>
|
|
71
|
+
</menu>
|
|
72
|
+
</k-aside>
|
|
73
|
+
<script src="https://cdn.jsdelivr.net/npm/kempo-ui@0.3.5/src/components/Aside.js" type="module"></script>
|
|
74
|
+
<script src="https://cdn.jsdelivr.net/npm/kempo-ui@0.3.5/src/components/Main.js" type="module"></script>
|
|
75
|
+
<script src="https://cdn.jsdelivr.net/npm/kempo-ui@0.3.5/src/components/Nav.js" type="module"></script>
|
|
76
|
+
<script src="https://cdn.jsdelivr.net/npm/kempo-ui@0.3.5/src/components/Icon.js" type="module"></script>
|
|
77
|
+
<script src="https://cdn.jsdelivr.net/npm/kempo-ui@0.3.5/src/components/ThemeSwitcher.js" type="module"></script>
|
|
78
|
+
<script>
|
|
79
|
+
document.getElementById('toggleNavSideMenu').addEventListener('click', async () => {
|
|
80
|
+
await window.customElements.whenDefined('k-aside');
|
|
81
|
+
document.getElementById('navSideMenu').toggle();
|
|
82
|
+
});
|
|
83
|
+
document.addEventListener('click', function(e) {
|
|
84
|
+
if (e.target.matches('a[href^="#"]')) {
|
|
85
|
+
e.preventDefault();
|
|
86
|
+
const targetId = e.target.getAttribute('href').replace('#', '');
|
|
87
|
+
const target = document.getElementById(targetId);
|
|
88
|
+
if (target) {
|
|
89
|
+
target.scrollIntoView({ behavior: 'smooth' });
|
|
90
|
+
const url = window.location.pathname + window.location.search + '#' + targetId;
|
|
91
|
+
history.replaceState(null, '', url);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
</script>
|
|
96
|
+
|
|
97
|
+
<main>
|
|
98
|
+
<h1 class="ta-center">File System Utilities</h1>
|
|
99
|
+
|
|
18
100
|
<p>The file system utilities provide common file and directory operations with Promise-based APIs for Node.js applications.</p>
|
|
19
101
|
|
|
20
102
|
<h2>Installation</h2>
|
|
@@ -113,8 +195,12 @@ async function backupProject() {
|
|
|
113
195
|
<li>Functions handle errors appropriately (e.g., ensureDir ignores EEXIST)</li>
|
|
114
196
|
<li>copyDir preserves directory structure recursively</li>
|
|
115
197
|
</ul>
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
198
|
+
|
|
199
|
+
</main>
|
|
200
|
+
<div style="height:25vh"></div>
|
|
201
|
+
<script
|
|
202
|
+
type="module"
|
|
203
|
+
src="https://cdn.jsdelivr.net/npm/kempo-ui@0.0.42/dist/components/Import.js"
|
|
204
|
+
></script>
|
|
119
205
|
</body>
|
|
120
206
|
</html>
|
|
@@ -1,19 +1,102 @@
|
|
|
1
|
-
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
2
3
|
<head>
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta
|
|
6
|
+
name="viewport"
|
|
7
|
+
content="width=device-width, initial-scale=1.0"
|
|
8
|
+
/>
|
|
9
|
+
<title>Getting Started - Kempo Server</title>
|
|
10
|
+
<link rel="icon" type="image/svg+xml" href="./media/icon.svg" />
|
|
11
|
+
<link rel="icon" type="image/png" sizes="32x32" href="./media/icon32.png" />
|
|
12
|
+
<link rel="manifest" href="./manifest.json" />
|
|
13
|
+
<link
|
|
14
|
+
rel="stylesheet"
|
|
15
|
+
href="https://cdn.jsdelivr.net/npm/kempo-css@2/dist/kempo.min.css"
|
|
16
|
+
/>
|
|
17
|
+
<link rel="stylesheet" href="./theme.css" />
|
|
18
|
+
<script>
|
|
19
|
+
window.litDisableBundleWarning = true;
|
|
20
|
+
window.kempo = { pathsToIcons: ['https://cdn.jsdelivr.net/npm/kempo-ui@0.0.42/icons/'] };
|
|
21
|
+
</script>
|
|
12
22
|
</head>
|
|
13
23
|
<body>
|
|
14
|
-
|
|
15
|
-
<k-
|
|
16
|
-
|
|
24
|
+
|
|
25
|
+
<k-nav
|
|
26
|
+
fixed
|
|
27
|
+
class="bg-primary"
|
|
28
|
+
>
|
|
29
|
+
<button
|
|
30
|
+
id="toggleNavSideMenu"
|
|
31
|
+
class="link"
|
|
32
|
+
>
|
|
33
|
+
<k-icon name="menu"></k-icon>
|
|
34
|
+
</button>
|
|
35
|
+
<a
|
|
36
|
+
href="./"
|
|
37
|
+
class="d-if ph"
|
|
38
|
+
style="align-items: center"
|
|
39
|
+
>
|
|
40
|
+
<img src="./media/icon32.png" alt="Kempo Server Icon" class="pr" />
|
|
41
|
+
Kempo Server
|
|
42
|
+
</a>
|
|
43
|
+
<div class="flex"></div>
|
|
44
|
+
<a href="https://github.com/dustinpoissant/kempo-ui?tab=License-1-ov-file#creative-commons-attribution-noncommercial-sharealike-20" target="_blank"><k-icon name="license"></k-icont></a>
|
|
45
|
+
<a href="https://github.com/dustinpoissant/kempo-ui" target="_blank"><k-icon name="github-mark"></k-icont></a>
|
|
46
|
+
<k-theme-switcher></k-theme-switcher>
|
|
47
|
+
</k-nav>
|
|
48
|
+
<div style="width: 100%; height: 4rem;"></div>
|
|
49
|
+
<k-aside
|
|
50
|
+
id="navSideMenu"
|
|
51
|
+
state="offscreen"
|
|
52
|
+
>
|
|
53
|
+
<menu>
|
|
54
|
+
<a href="./" class="ta-center bb mb r0">
|
|
55
|
+
<h1 class="tc-primary">Kempo Server</h1>
|
|
56
|
+
<img src="./media/icon128.png" alt="Kempo UI Icon" />
|
|
57
|
+
</a>
|
|
58
|
+
<h3>Getting Started</h3>
|
|
59
|
+
<a href="./" class="d-b pq pl">Quick Start</a>
|
|
60
|
+
<a href="./routing.html" class="d-b pq pl">Routing</a>
|
|
61
|
+
<a href="./request-response.html" class="d-b pq pl">Request & Response</a>
|
|
62
|
+
<br /><br />
|
|
63
|
+
<h3>Advanced Features</h3>
|
|
64
|
+
<a href="configuration.html" class="d-b pq pl">Configuration</a>
|
|
65
|
+
<a href="templating.html" class="d-b pq pl">Templating</a>
|
|
66
|
+
<a href="middleware.html" class="d-b pq pl">Middleware</a>
|
|
67
|
+
<a href="caching.html" class="d-b pq pl">Module Caching</a>
|
|
68
|
+
<a href="cli-utils.html" class="d-b pq pl">CLI Utilities</a>
|
|
69
|
+
<a href="fs-utils.html" class="d-b pq pl">File System Utilities</a>
|
|
70
|
+
<a href="examples.html" class="d-b pq pl">Examples & Demos</a>
|
|
71
|
+
</menu>
|
|
72
|
+
</k-aside>
|
|
73
|
+
<script src="https://cdn.jsdelivr.net/npm/kempo-ui@0.3.5/src/components/Aside.js" type="module"></script>
|
|
74
|
+
<script src="https://cdn.jsdelivr.net/npm/kempo-ui@0.3.5/src/components/Main.js" type="module"></script>
|
|
75
|
+
<script src="https://cdn.jsdelivr.net/npm/kempo-ui@0.3.5/src/components/Nav.js" type="module"></script>
|
|
76
|
+
<script src="https://cdn.jsdelivr.net/npm/kempo-ui@0.3.5/src/components/Icon.js" type="module"></script>
|
|
77
|
+
<script src="https://cdn.jsdelivr.net/npm/kempo-ui@0.3.5/src/components/ThemeSwitcher.js" type="module"></script>
|
|
78
|
+
<script>
|
|
79
|
+
document.getElementById('toggleNavSideMenu').addEventListener('click', async () => {
|
|
80
|
+
await window.customElements.whenDefined('k-aside');
|
|
81
|
+
document.getElementById('navSideMenu').toggle();
|
|
82
|
+
});
|
|
83
|
+
document.addEventListener('click', function(e) {
|
|
84
|
+
if (e.target.matches('a[href^="#"]')) {
|
|
85
|
+
e.preventDefault();
|
|
86
|
+
const targetId = e.target.getAttribute('href').replace('#', '');
|
|
87
|
+
const target = document.getElementById(targetId);
|
|
88
|
+
if (target) {
|
|
89
|
+
target.scrollIntoView({ behavior: 'smooth' });
|
|
90
|
+
const url = window.location.pathname + window.location.search + '#' + targetId;
|
|
91
|
+
history.replaceState(null, '', url);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
</script>
|
|
96
|
+
|
|
97
|
+
<main>
|
|
98
|
+
<h1 class="ta-center">Getting Started</h1>
|
|
99
|
+
|
|
17
100
|
<p>Get up and running with Kempo Server in just a few steps.</p>
|
|
18
101
|
|
|
19
102
|
<h2>Installation</h2>
|
|
@@ -73,8 +156,12 @@
|
|
|
73
156
|
<li><a href="middleware.html">Middleware</a> - Add authentication, logging, CORS, and more</li>
|
|
74
157
|
<li><a href="examples.html">Examples & Demos</a> - See real-world examples in action</li>
|
|
75
158
|
</ul>
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
159
|
+
|
|
160
|
+
</main>
|
|
161
|
+
<div style="height:25vh"></div>
|
|
162
|
+
<script
|
|
163
|
+
type="module"
|
|
164
|
+
src="https://cdn.jsdelivr.net/npm/kempo-ui@0.0.42/dist/components/Import.js"
|
|
165
|
+
></script>
|
|
79
166
|
</body>
|
|
80
|
-
</html>
|
|
167
|
+
</html>
|