kempo-server 2.1.1 → 3.0.0
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 +31 -4
- package/SPA.md +14 -14
- package/UTILS.md +39 -0
- package/dist/defaultConfig.js +1 -1
- package/dist/index.js +1 -1
- package/dist/render.js +2 -0
- package/dist/rescan.js +1 -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/dist/caching.html +324 -0
- package/docs/dist/cli-utils.html +175 -0
- package/docs/dist/configuration.html +414 -0
- package/docs/dist/examples.html +296 -0
- package/docs/dist/fs-utils.html +206 -0
- package/docs/dist/getting-started.html +167 -0
- package/docs/dist/index.html +183 -0
- package/docs/dist/middleware.html +237 -0
- package/docs/dist/request-response.html +200 -0
- package/docs/dist/routing.html +177 -0
- package/docs/dist/templating.html +292 -0
- package/docs/{theme.css → dist/theme.css} +1 -3
- package/docs/src/.config.js +11 -0
- package/docs/{caching.html → src/caching.page.html} +4 -19
- package/docs/{cli-utils.html → src/cli-utils.page.html} +4 -20
- package/docs/{configuration.html → src/configuration.page.html} +4 -18
- package/docs/src/default.template.html +35 -0
- package/docs/{examples.html → src/examples.page.html} +9 -18
- package/docs/{fs-utils.html → src/fs-utils.page.html} +4 -20
- package/docs/{getting-started.html → src/getting-started.page.html} +4 -18
- package/docs/src/index.page.html +79 -0
- package/docs/{middleware.html → src/middleware.page.html} +4 -18
- package/docs/src/nav.fragment.html +73 -0
- package/docs/{request-response.html → src/request-response.page.html} +4 -18
- package/docs/{routing.html → src/routing.page.html} +4 -18
- package/docs/src/templating.page.html +188 -0
- package/{llm.txt → llms.txt} +100 -30
- package/package.json +7 -3
- package/scripts/build.js +19 -11
- package/scripts/render.js +58 -0
- package/src/defaultConfig.js +14 -2
- package/src/index.js +1 -1
- package/src/rescan.js +14 -0
- package/src/router.js +82 -11
- 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/rescan.node-test.js +69 -0
- 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/index.html +0 -88
- package/docs/init.js +0 -0
- package/docs/kempo.min.css +0 -1
- package/docs/nav.inc.html +0 -41
- package/docs/nav.inc.js +0 -16
- /package/docs/{manifest.json → dist/manifest.json} +0 -0
- /package/docs/{media → dist/media}/hexagon.svg +0 -0
- /package/docs/{media → dist/media}/icon-maskable.png +0 -0
- /package/docs/{media → dist/media}/icon.svg +0 -0
- /package/docs/{media → dist/media}/icon128.png +0 -0
- /package/docs/{media → dist/media}/icon144.png +0 -0
- /package/docs/{media → dist/media}/icon152.png +0 -0
- /package/docs/{media → dist/media}/icon16-48.svg +0 -0
- /package/docs/{media → dist/media}/icon16.png +0 -0
- /package/docs/{media → dist/media}/icon192.png +0 -0
- /package/docs/{media → dist/media}/icon256.png +0 -0
- /package/docs/{media → dist/media}/icon32.png +0 -0
- /package/docs/{media → dist/media}/icon384.png +0 -0
- /package/docs/{media → dist/media}/icon48.png +0 -0
- /package/docs/{media → dist/media}/icon512.png +0 -0
- /package/docs/{media → dist/media}/icon64.png +0 -0
- /package/docs/{media → dist/media}/icon72.png +0 -0
- /package/docs/{media → dist/media}/icon96.png +0 -0
- /package/docs/{media → dist/media}/kempo-fist.svg +0 -0
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
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>
|
|
22
|
+
</head>
|
|
23
|
+
<body>
|
|
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
|
+
|
|
100
|
+
<p>Get up and running with Kempo Server in just a few steps.</p>
|
|
101
|
+
|
|
102
|
+
<h2>Installation</h2>
|
|
103
|
+
<p>1. Install the npm package.</p>
|
|
104
|
+
<pre><code>npm install kempo-server</code></pre>
|
|
105
|
+
|
|
106
|
+
<p>2. Add it to your <code>package.json</code> scripts, use the <code>--root</code> flag to tell it where the root of your site is.</p>
|
|
107
|
+
<pre><code class="hljs json">{<br /> ...<br /> <span class="hljs-attr">"scripts"</span>: {<br /> <span class="hljs-attr">"start"</span>: <span class="hljs-string">"kempo-server --root public"</span><br /> }<br /> ...<br />}</code></pre>
|
|
108
|
+
|
|
109
|
+
<p>3. Run it in your terminal.</p>
|
|
110
|
+
<pre><code>npm run start</code></pre>
|
|
111
|
+
|
|
112
|
+
<h2>Basic Project Structure</h2>
|
|
113
|
+
<p>Once installed, create a basic project structure:</p>
|
|
114
|
+
<pre><code class="hljs markdown">my-project/<br />├─ public/ # Your web root<br />│ ├─ index.html # Homepage<br />│ ├─ styles.css # CSS files<br />│ ├─ api/ # API routes<br />│ │ ├─ hello/<br />│ │ │ ├─ GET.js # GET /api/hello/<br />│ │ ├─ users/<br />│ │ │ ├─ GET.js # GET /api/users/<br />│ │ │ ├─ POST.js # POST /api/users/<br />├─ package.json<br />├─ .config.json # Optional configuration<br /></code></pre>
|
|
115
|
+
|
|
116
|
+
<h2>Your First Route</h2>
|
|
117
|
+
<p>Create a simple API endpoint:</p>
|
|
118
|
+
|
|
119
|
+
<h3>1. Create the directory structure</h3>
|
|
120
|
+
<pre><code>mkdir -p public/api/hello</code></pre>
|
|
121
|
+
|
|
122
|
+
<h3>2. Create your first route file</h3>
|
|
123
|
+
<p>Create <code>public/api/hello/GET.js</code>:</p>
|
|
124
|
+
<pre><code class="hljs javascript"><span class="hljs-comment">// public/api/hello/GET.js</span><br /><span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-keyword">async</span> <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">request, response</span>) </span>{<br /> <span class="hljs-keyword">const</span> { name } = request.query;<br /> <span class="hljs-keyword">const</span> message = name ? <span class="hljs-string">`Hello ${name}!`</span> : <span class="hljs-string">'Hello World!'</span>;<br /> <br /> response.json({ message, timestamp: <span class="hljs-keyword">new</span> <span class="hljs-built_in">Date</span>().toISOString() });<br />}</code></pre>
|
|
125
|
+
|
|
126
|
+
<h3>3. Test your route</h3>
|
|
127
|
+
<p>Start your server and visit:</p>
|
|
128
|
+
<ul>
|
|
129
|
+
<li><code>http://localhost:3000/api/hello/</code></li>
|
|
130
|
+
<li><code>http://localhost:3000/api/hello/?name=World</code></li>
|
|
131
|
+
</ul>
|
|
132
|
+
|
|
133
|
+
<h2>Command Line Options</h2>
|
|
134
|
+
<p>Kempo Server supports several command line options:</p>
|
|
135
|
+
<ul>
|
|
136
|
+
<li><code>--root <path></code> - Set the document root directory (required)</li>
|
|
137
|
+
<li><code>--port <number></code> - Set the port number (default: 3000)</li>
|
|
138
|
+
<li><code>--host <address></code> - Set the host address (default: localhost)</li>
|
|
139
|
+
<li><code>--config <path></code> - Set the configuration file path (default: .config.json)</li>
|
|
140
|
+
<li><code>--verbose</code> - Enable verbose logging</li>
|
|
141
|
+
</ul>
|
|
142
|
+
|
|
143
|
+
<p>Basic example:</p>
|
|
144
|
+
<pre><code>kempo-server --root public --port 8080 --host 0.0.0.0 --verbose</code></pre>
|
|
145
|
+
|
|
146
|
+
<h3>Configuration File Examples</h3>
|
|
147
|
+
<p>You can specify different configuration files for different environments:</p>
|
|
148
|
+
<pre><code class="hljs bash"># Development<br />kempo-server --root public --config dev.config.json<br /><br /># Staging<br />kempo-server --root public --config staging.config.json<br /><br /># Production with absolute path<br />kempo-server --root public --config /etc/kempo/production.config.json<br /><br /># Mix with other options<br />kempo-server --root dist --port 8080 --config production.config.json</code></pre>
|
|
149
|
+
|
|
150
|
+
<h2>What's Next?</h2>
|
|
151
|
+
<p>Now that you have Kempo Server running, explore these topics:</p>
|
|
152
|
+
<ul>
|
|
153
|
+
<li><a href="routing.html">Learn about Routes & Routing</a> - File-based routing, dynamic routes, and HTML routes</li>
|
|
154
|
+
<li><a href="request-response.html">Request & Response Objects</a> - Working with HTTP requests and responses</li>
|
|
155
|
+
<li><a href="configuration.html">Configuration</a> - Customize server behavior</li>
|
|
156
|
+
<li><a href="middleware.html">Middleware</a> - Add authentication, logging, CORS, and more</li>
|
|
157
|
+
<li><a href="examples.html">Examples & Demos</a> - See real-world examples in action</li>
|
|
158
|
+
</ul>
|
|
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>
|
|
166
|
+
</body>
|
|
167
|
+
</html>
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta
|
|
6
|
+
name="viewport"
|
|
7
|
+
content="width=device-width, initial-scale=1.0"
|
|
8
|
+
/>
|
|
9
|
+
<title>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>
|
|
22
|
+
</head>
|
|
23
|
+
<body>
|
|
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">Kempo Server</h1>
|
|
99
|
+
|
|
100
|
+
<div class="ta-center">
|
|
101
|
+
<p class="mb0">
|
|
102
|
+
<a
|
|
103
|
+
href="https://github.com/dustinpoissant/kempo-server"
|
|
104
|
+
class="btn primary mr"
|
|
105
|
+
target="_blank"
|
|
106
|
+
>GitHub</a>
|
|
107
|
+
<a
|
|
108
|
+
href="https://www.npmjs.com/package/kempo-server"
|
|
109
|
+
class="btn"
|
|
110
|
+
target="_blank"
|
|
111
|
+
>NPM</a>
|
|
112
|
+
</p>
|
|
113
|
+
</div>
|
|
114
|
+
<p>A lightweight, zero-dependency, file based routing server.</p>
|
|
115
|
+
|
|
116
|
+
<nav class="b r mb p">
|
|
117
|
+
<div class="row -mx">
|
|
118
|
+
<div class="col m-span-12 d-span-6 px">
|
|
119
|
+
<h4 class="mt0">Getting Started</h4>
|
|
120
|
+
<ul>
|
|
121
|
+
<li><a href="getting-started.html">Getting Started</a></li>
|
|
122
|
+
<li><a href="routing.html">Routing</a></li>
|
|
123
|
+
<li><a href="request-response.html">Request & Response</a></li>
|
|
124
|
+
</ul>
|
|
125
|
+
</div>
|
|
126
|
+
<div class="col m-span-12 d-span-6 px">
|
|
127
|
+
<h4 class="mt0">Advanced Features</h4>
|
|
128
|
+
<ul>
|
|
129
|
+
<li><a href="configuration.html">Configuration</a></li>
|
|
130
|
+
<li><a href="templating.html">Templating</a></li>
|
|
131
|
+
<li><a href="middleware.html">Middleware</a></li>
|
|
132
|
+
<li><a href="caching.html">Module Caching</a></li>
|
|
133
|
+
<li><a href="cli-utils.html">CLI Utilities</a></li>
|
|
134
|
+
<li><a href="fs-utils.html">File System Utilities</a></li>
|
|
135
|
+
<li><a href="examples.html">Examples & Demos</a></li>
|
|
136
|
+
</ul>
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
</nav>
|
|
140
|
+
|
|
141
|
+
<div class="b r mb p">
|
|
142
|
+
<h3 class="mt0">Quick Start</h3>
|
|
143
|
+
<p>Install and run Kempo Server in seconds:</p>
|
|
144
|
+
<pre><code>npm install kempo-server<br />npx kempo-server --root public</code></pre>
|
|
145
|
+
</div>
|
|
146
|
+
|
|
147
|
+
<div class="row -mx mb">
|
|
148
|
+
<div class="col m-span-12 d-span-6 px">
|
|
149
|
+
<div class="b r p">
|
|
150
|
+
<h4 class="mt0">Features</h4>
|
|
151
|
+
<ul>
|
|
152
|
+
<li><strong>Zero Dependencies</strong> - No external dependencies</li>
|
|
153
|
+
<li><strong>File-based Routing</strong> - Directory structure defines routes</li>
|
|
154
|
+
<li><strong>Dynamic Routes</strong> - Parameterized routes with [brackets]</li>
|
|
155
|
+
<li><strong>Wildcard Routes</strong> - Map directories with * patterns</li>
|
|
156
|
+
<li><strong>Middleware System</strong> - Authentication, CORS, logging, and more</li>
|
|
157
|
+
<li><strong>Request/Response Objects</strong> - Enhanced request handling</li>
|
|
158
|
+
</ul>
|
|
159
|
+
</div>
|
|
160
|
+
</div>
|
|
161
|
+
<div class="col m-span-12 d-span-6 px">
|
|
162
|
+
<div class="b r p">
|
|
163
|
+
<h4 class="mt0">Built-in Middleware</h4>
|
|
164
|
+
<ul>
|
|
165
|
+
<li><strong>CORS</strong> - Cross-origin resource sharing</li>
|
|
166
|
+
<li><strong>Compression</strong> - Automatic gzip compression</li>
|
|
167
|
+
<li><strong>Rate Limiting</strong> - Request throttling</li>
|
|
168
|
+
<li><strong>Security Headers</strong> - Security best practices</li>
|
|
169
|
+
<li><strong>Request Logging</strong> - Configurable logging</li>
|
|
170
|
+
<li><strong>Custom Middleware</strong> - Load your own middleware</li>
|
|
171
|
+
</ul>
|
|
172
|
+
</div>
|
|
173
|
+
</div>
|
|
174
|
+
</div>
|
|
175
|
+
|
|
176
|
+
</main>
|
|
177
|
+
<div style="height:25vh"></div>
|
|
178
|
+
<script
|
|
179
|
+
type="module"
|
|
180
|
+
src="https://cdn.jsdelivr.net/npm/kempo-ui@0.0.42/dist/components/Import.js"
|
|
181
|
+
></script>
|
|
182
|
+
</body>
|
|
183
|
+
</html>
|