From 445b6f7c71b63eb798185c173a37ad5d09546bda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=CA=9C=C9=AA=C9=B4=E1=B4=87=C9=AA=20N=E1=B4=8F=E1=B4=9C?= =?UTF-8?q?=E1=B4=A2=E1=B4=87=C9=B4?= <157171073+Shineii86@users.noreply.github.com> Date: Mon, 8 Jun 2026 21:21:55 +0530 Subject: [PATCH] =?UTF-8?q?fix:=20clean=20URLs=20=E2=80=94=20/tos=20and=20?= =?UTF-8?q?/privacy=20instead=20of=20/tos.html=20and=20/privacy.html?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- CHANGELOG.md | 4 ++++ README.md | 6 +++--- docs/architecture.md | 6 +++--- public/index.html | 4 ++-- public/privacy.html | 2 +- public/sitemap.xml | 4 ++-- public/tos.html | 2 +- server.js | 13 +++++++++++++ 8 files changed, 29 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ac2b9b..8d36c7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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/examples.md` — Code examples in cURL, JavaScript, Python, Node.js (all tested) - `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 ### Fixed diff --git a/README.md b/README.md index c87b354..da4ef7b 100644 --- a/README.md +++ b/README.md @@ -292,11 +292,11 @@ AniKotoAPI/ ├── 📂 public/ # 🌐 Static files │ ├── 📄 index.html # 📖 Premium landing page (SVG icons, live console) │ ├── 📄 404.html # ❌ Custom 404 error page (glitch animation) -│ ├── 📄 tos.html # 📋 Terms of Service page -│ ├── 📄 privacy.html # 🔒 Privacy Policy page +│ ├── 📄 tos.html # 📋 Terms of Service (served at /tos) +│ ├── 📄 privacy.html # 🔒 Privacy Policy (served at /privacy) │ ├── 📄 manifest.json # 📱 PWA manifest (theme: #A855F7) │ ├── 📄 robots.txt # 🤖 Crawler directives -│ ├── 📄 sitemap.xml # 🗺️ Sitemap (4 pages) +│ ├── 📄 sitemap.xml # 🗺️ Sitemap (4 pages: /, /tos, /privacy, /api) │ ├── 📄 og-image.svg # 🖼️ SVG Open Graph image │ │ │ ├── 📂 docs/ # 📚 API documentation diff --git a/docs/architecture.md b/docs/architecture.md index 7ea15f4..d1d1c6c 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -14,10 +14,10 @@ AniKotoAPI/ │ ├── 404.html # Glitch animation error page │ ├── manifest.json # PWA manifest (theme: #A855F7) │ ├── 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 -│ ├── privacy.html # Privacy policy -│ └── tos.html # Terms of service +│ ├── privacy.html # Privacy policy (served at /privacy) +│ └── tos.html # Terms of service (served at /tos) │ ├── docs/ # API documentation │ ├── index.md # Overview, quick start, features diff --git a/public/index.html b/public/index.html index 25bf9ed..6367ffe 100644 --- a/public/index.html +++ b/public/index.html @@ -538,8 +538,8 @@ fetch("https://anikototvapi.vercel.app/api") - + \ No newline at end of file diff --git a/public/sitemap.xml b/public/sitemap.xml index 3a13852..ab9efc7 100644 --- a/public/sitemap.xml +++ b/public/sitemap.xml @@ -13,13 +13,13 @@ 0.9 - https://anikototvapi.vercel.app/privacy.html + https://anikototvapi.vercel.app//privacy 2026-06-08 monthly 0.3 - https://anikototvapi.vercel.app/tos.html + https://anikototvapi.vercel.app//tos 2026-06-08 monthly 0.3 diff --git a/public/tos.html b/public/tos.html index 4d3d6be..843a8c9 100644 --- a/public/tos.html +++ b/public/tos.html @@ -89,6 +89,6 @@

13. Contact

For questions about these Terms, open an issue at github.com/Shineii86/AniKotoAPI/issues.

- + \ No newline at end of file diff --git a/server.js b/server.js index 6d9e6b8..1df7ca4 100644 --- a/server.js +++ b/server.js @@ -74,6 +74,19 @@ app.use((req, res, next) => { // NOTE: redirect: false prevents automatic redirects to index.html 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 // ══════════════════════════════════════════════════════════════