fix: clean URLs — /tos and /privacy instead of /tos.html and /privacy.html

- Added Express routes for /tos and /privacy
- Updated all internal links (index.html, privacy.html, tos.html)
- Updated sitemap.xml URLs
- Updated README and docs architecture
This commit is contained in:
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ
2026-06-08 21:21:55 +05:30
parent ff802247f3
commit 445b6f7c71
8 changed files with 29 additions and 12 deletions
+4
View File
@@ -14,6 +14,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `docs/streaming.md` — Streaming flow guide (3-step with real data) - `docs/streaming.md` — Streaming flow guide (3-step with real data)
- `docs/examples.md` — Code examples in cURL, JavaScript, Python, Node.js (all tested) - `docs/examples.md` — Code examples in cURL, JavaScript, Python, Node.js (all tested)
- `docs/architecture.md` — Project structure, tech stack, design decisions - `docs/architecture.md` — Project structure, tech stack, design decisions
### Fixed
- Clean URLs: `/tos` and `/privacy` instead of `/tos.html` and `/privacy.html`
- Added Express routes for clean URL serving
- `docs/architecture.md` — Project structure, tech stack, design decisions - `docs/architecture.md` — Project structure, tech stack, design decisions
### Fixed ### Fixed
+3 -3
View File
@@ -292,11 +292,11 @@ AniKotoAPI/
├── 📂 public/ # 🌐 Static files ├── 📂 public/ # 🌐 Static files
│ ├── 📄 index.html # 📖 Premium landing page (SVG icons, live console) │ ├── 📄 index.html # 📖 Premium landing page (SVG icons, live console)
│ ├── 📄 404.html # ❌ Custom 404 error page (glitch animation) │ ├── 📄 404.html # ❌ Custom 404 error page (glitch animation)
│ ├── 📄 tos.html # 📋 Terms of Service page │ ├── 📄 tos.html # 📋 Terms of Service (served at /tos)
│ ├── 📄 privacy.html # 🔒 Privacy Policy page │ ├── 📄 privacy.html # 🔒 Privacy Policy (served at /privacy)
│ ├── 📄 manifest.json # 📱 PWA manifest (theme: #A855F7) │ ├── 📄 manifest.json # 📱 PWA manifest (theme: #A855F7)
│ ├── 📄 robots.txt # 🤖 Crawler directives │ ├── 📄 robots.txt # 🤖 Crawler directives
│ ├── 📄 sitemap.xml # 🗺️ Sitemap (4 pages) │ ├── 📄 sitemap.xml # 🗺️ Sitemap (4 pages: /, /tos, /privacy, /api)
│ ├── 📄 og-image.svg # 🖼️ SVG Open Graph image │ ├── 📄 og-image.svg # 🖼️ SVG Open Graph image
│ │ │ │
│ ├── 📂 docs/ # 📚 API documentation │ ├── 📂 docs/ # 📚 API documentation
+3 -3
View File
@@ -14,10 +14,10 @@ AniKotoAPI/
│ ├── 404.html # Glitch animation error page │ ├── 404.html # Glitch animation error page
│ ├── manifest.json # PWA manifest (theme: #A855F7) │ ├── manifest.json # PWA manifest (theme: #A855F7)
│ ├── robots.txt # Crawler directives │ ├── robots.txt # Crawler directives
│ ├── sitemap.xml # 4 pages (home, api, privacy, tos) │ ├── sitemap.xml # 4 pages (/, /tos, /privacy, /api)
│ ├── og-image.svg # SVG Open Graph image │ ├── og-image.svg # SVG Open Graph image
│ ├── privacy.html # Privacy policy │ ├── privacy.html # Privacy policy (served at /privacy)
│ └── tos.html # Terms of service │ └── tos.html # Terms of service (served at /tos)
│ │
├── docs/ # API documentation ├── docs/ # API documentation
│ ├── index.md # Overview, quick start, features │ ├── index.md # Overview, quick start, features
+2 -2
View File
@@ -538,8 +538,8 @@ fetch("https://anikototvapi.vercel.app/api")
</div> </div>
<div class="footer-col"> <div class="footer-col">
<h4>Legal</h4> <h4>Legal</h4>
<a href="/privacy.html">Privacy Policy</a> <a href="//privacy">Privacy Policy</a>
<a href="/tos.html">Terms of Service</a> <a href="//tos">Terms of Service</a>
</div> </div>
</div> </div>
<div class="footer-bottom"> <div class="footer-bottom">
+1 -1
View File
@@ -78,6 +78,6 @@
<h2>8. Contact</h2> <h2>8. Contact</h2>
<p>For questions about this Privacy Policy, open an issue at <a href="https://github.com/Shineii86/AniKotoAPI/issues" target="_blank">github.com/Shineii86/AniKotoAPI/issues</a>.</p> <p>For questions about this Privacy Policy, open an issue at <a href="https://github.com/Shineii86/AniKotoAPI/issues" target="_blank">github.com/Shineii86/AniKotoAPI/issues</a>.</p>
</div> </div>
<footer>&copy; 2026 AniKotoAPI &middot; <a href="/" style="color:var(--purple)">Home</a> &middot; <a href="/tos.html" style="color:var(--purple)">Terms</a></footer> <footer>&copy; 2026 AniKotoAPI &middot; <a href="/" style="color:var(--purple)">Home</a> &middot; <a href="//tos" style="color:var(--purple)">Terms</a></footer>
</body> </body>
</html> </html>
+2 -2
View File
@@ -13,13 +13,13 @@
<priority>0.9</priority> <priority>0.9</priority>
</url> </url>
<url> <url>
<loc>https://anikototvapi.vercel.app/privacy.html</loc> <loc>https://anikototvapi.vercel.app//privacy</loc>
<lastmod>2026-06-08</lastmod> <lastmod>2026-06-08</lastmod>
<changefreq>monthly</changefreq> <changefreq>monthly</changefreq>
<priority>0.3</priority> <priority>0.3</priority>
</url> </url>
<url> <url>
<loc>https://anikototvapi.vercel.app/tos.html</loc> <loc>https://anikototvapi.vercel.app//tos</loc>
<lastmod>2026-06-08</lastmod> <lastmod>2026-06-08</lastmod>
<changefreq>monthly</changefreq> <changefreq>monthly</changefreq>
<priority>0.3</priority> <priority>0.3</priority>
+1 -1
View File
@@ -89,6 +89,6 @@
<h2>13. Contact</h2> <h2>13. Contact</h2>
<p>For questions about these Terms, open an issue at <a href="https://github.com/Shineii86/AniKotoAPI/issues" target="_blank">github.com/Shineii86/AniKotoAPI/issues</a>.</p> <p>For questions about these Terms, open an issue at <a href="https://github.com/Shineii86/AniKotoAPI/issues" target="_blank">github.com/Shineii86/AniKotoAPI/issues</a>.</p>
</div> </div>
<footer>&copy; 2026 AniKotoAPI &middot; <a href="/" style="color:var(--purple)">Home</a> &middot; <a href="/privacy.html" style="color:var(--purple)">Privacy</a></footer> <footer>&copy; 2026 AniKotoAPI &middot; <a href="/" style="color:var(--purple)">Home</a> &middot; <a href="//privacy" style="color:var(--purple)">Privacy</a></footer>
</body> </body>
</html> </html>
+13
View File
@@ -74,6 +74,19 @@ app.use((req, res, next) => {
// NOTE: redirect: false prevents automatic redirects to index.html // NOTE: redirect: false prevents automatic redirects to index.html
app.use(express.static(publicDir, { redirect: false })); app.use(express.static(publicDir, { redirect: false }));
// ══════════════════════════════════════════════════════════════
// CLEAN URL ROUTES
// ══════════════════════════════════════════════════════════════
// Serve HTML files without .html extension
app.get("/tos", (req, res) => {
res.sendFile(path.join(publicDir, "tos.html"));
});
app.get("/privacy", (req, res) => {
res.sendFile(path.join(publicDir, "privacy.html"));
});
// ══════════════════════════════════════════════════════════════ // ══════════════════════════════════════════════════════════════
// RESPONSE HELPERS // RESPONSE HELPERS
// ══════════════════════════════════════════════════════════════ // ══════════════════════════════════════════════════════════════