feat: drop /docs URL prefix (variant B, shorter URLs) + bump 0.0.2

This commit is contained in:
“Naeel”
2026-09-02 15:17:14 +03:00
parent 69460e9652
commit 658e6e9c7f
3 changed files with 9 additions and 25 deletions
+5 -5
View File
@@ -22,21 +22,21 @@ async function withServer(fn) {
test('candidates: trailing slash -> index.html', () => {
assert.deepStrictEqual(
getDocsCandidates('/docs/nubes/nubes/1.0.0/'),
getDocsCandidates('/nubes/nubes/1.0.0/'),
['docs/nubes/nubes/1.0.0/index.html']
);
});
test('candidates: file with extension -> exact + root index fallback', () => {
assert.deepStrictEqual(
getDocsCandidates('/docs/nubes/nubes/1.0.0/page.html'),
getDocsCandidates('/nubes/nubes/1.0.0/page.html'),
['docs/nubes/nubes/1.0.0/page.html', 'docs/nubes/nubes/1.0.0/index.html']
);
});
test('candidates: directory-style path -> exact + index.html + root index', () => {
assert.deepStrictEqual(
getDocsCandidates('/docs/nubes/nubes/1.0.0/guides/getting-started'),
getDocsCandidates('/nubes/nubes/1.0.0/guides/getting-started'),
[
'docs/nubes/nubes/1.0.0/guides/getting-started',
'docs/nubes/nubes/1.0.0/guides/getting-started/index.html',
@@ -91,7 +91,7 @@ test('GET /docs/... -> 200 streams body with content-type', async () => {
return { $metadata: { httpStatusCode: 200 } };
};
await withServer(async (base) => {
const res = await fetch(`${base}/docs/nubes/nubes/1.0.0/`);
const res = await fetch(`${base}/nubes/nubes/1.0.0/`);
assert.strictEqual(res.status, 200);
assert.match(res.headers.get('content-type') || '', /text\/html/);
assert.strictEqual(await res.text(), '<html>ok</html>');
@@ -110,7 +110,7 @@ test('GET /docs/... -> 404 when no key found', async () => {
return { $metadata: { httpStatusCode: 200 } };
};
await withServer(async (base) => {
const res = await fetch(`${base}/docs/nubes/nubes/1.0.0/missing`);
const res = await fetch(`${base}/nubes/nubes/1.0.0/missing`);
assert.strictEqual(res.status, 404);
});
s3.send = originalSend;