diff --git a/.env.example b/.env.example
new file mode 100644
index 0000000..1804c18
--- /dev/null
+++ b/.env.example
@@ -0,0 +1,5 @@
+# Origins you want to allow
+ALLOWED_ORIGINS=https://site1.com,https://site2.com
+
+# Port (optional, defaults to 3000)
+PORT=3000
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1144f43..894ca05 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,26 @@
# Changelog
+## v1.3.0
+- Full landing page upgrade to match AniKotoAPI style
+- Added canvas particle effects with cyan-colored floating particles
+- Added scroll-reveal animations (IntersectionObserver)
+- Added animated stat counters that count up on scroll
+- Added infinite scrolling marquee with 8 feature badges
+- Added live interactive API console with 5 preset endpoint buttons
+- Added sidebar endpoint explorer with 16 endpoints and multi-language code tabs (cURL, JavaScript, Python)
+- Added 4 interactive playground cards (Search, Info, Episodes, Trending)
+- Added custom scrollbar styling
+- Added JetBrains Mono font for code blocks
+- Added 4-column grid footer with API, Resources, Legal sections
+- Added fixed header with scroll-aware blur/glass effect
+- Added ambient orb gradient animations
+- Added CTA section with gradient overlay
+- Color scheme updated to match MiruroAPI brand (cyan #38bdf8 + indigo #818cf8)
+- All branding updated: AniKotoAPI references → MiruroAPI
+- OG/Twitter meta tags updated for mirurotvapi.vercel.app
+- JSON-LD structured data updated with image, category, programmingModel
+- Real Miruro SVG favicons used in header and footer
+
## v1.2.0
- Fixed critical response format bug: all endpoints now return {success: true, results: data}
- Root cause: createApiRoutes() had (app, jsonResponse, jsonError) but was called with (jsonResponse, jsonError), shifting all params
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..4e943cf
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,80 @@
+# Contributing to MiruroAPI
+
+Thank you for your interest in contributing! Here's how you can help.
+
+## Getting Started
+
+1. Fork the repository
+2. Clone your fork: `git clone https://github.com/YOUR_USERNAME/MiruroAPI.git`
+3. Create a branch: `git checkout -b feature/amazing-feature`
+4. Make your changes
+5. Commit: `git commit -m 'feat: add amazing feature'`
+6. Push: `git push origin feature/amazing-feature`
+7. Open a Pull Request
+
+## Development Setup
+
+```bash
+# Install dependencies
+npm install
+
+# Start development server
+npm run dev
+
+# Server runs on http://localhost:3000
+```
+
+## Project Structure
+
+```
+MiruroAPI/
+├── server.js # Express entry point
+├── src/
+│ ├── helpers/ # AniList, pipe, cache integrations
+│ └── routes/ # Express routes
+├── public/ # Static files (landing page, Swagger UI)
+└── docs/ # API documentation
+```
+
+## Adding a New Endpoint
+
+1. Create helper in `src/helpers/yourHelper.js` if needed
+2. Add route in `src/routes/apiRoutes.js`
+3. Update `docs/endpoints.md` with documentation
+4. Test with `curl http://localhost:3000/api/your-endpoint`
+
+## Code Style
+
+- Use CommonJS (`require`/`module.exports`)
+- Add JSDoc comments for new functions
+- Follow existing patterns in the codebase
+- Keep helpers focused on one task
+
+## Commit Messages
+
+Use [Conventional Commits](https://www.conventionalcommits.org/):
+
+- `feat:` new feature
+- `fix:` bug fix
+- `docs:` documentation changes
+- `refactor:` code refactoring
+- `test:` adding tests
+- `chore:` maintenance
+
+## Pull Request Guidelines
+
+- Keep PRs focused on one feature or fix
+- Update CHANGELOG.md with your changes
+- Test your changes locally before submitting
+- Follow existing code style
+
+## Reporting Issues
+
+- Use GitHub Issues for bug reports
+- Include steps to reproduce
+- Include expected vs actual behavior
+- Include your Node.js version
+
+## License
+
+By contributing, you agree that your contributions will be licensed under the MIT License.
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..09f4b98
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2026 Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/docs/architecture.md b/docs/architecture.md
new file mode 100644
index 0000000..043e836
--- /dev/null
+++ b/docs/architecture.md
@@ -0,0 +1,190 @@
+# Architecture
+
+## Project Structure
+
+```
+MiruroAPI/
+├── server.js # Express entry point, port 3000
+├── package.json # name: "miruro-api"
+├── vercel.json # Routes /api/* and /* to server.js
+├── Dockerfile # Docker support (node:20-alpine)
+├── .dockerignore # Docker ignore file
+│
+├── public/ # Static files served from process.cwd()
+│ ├── index.html # Premium landing page (SVG icons, live console)
+│ ├── docs.html # Swagger UI interactive documentation
+│ ├── openapi.json # OpenAPI 3.0 spec
+│ ├── 404.html # Glitch animation error page
+│ ├── manifest.json # PWA manifest (theme: #A855F7)
+│ ├── robots.txt # Crawler directives
+│ ├── sitemap.xml # 4 pages (/, /tos, /privacy, /api)
+│ ├── icon-dark.svg # Miruro dark mode SVG icon
+│ ├── icon-light.svg # Miruro light mode SVG icon
+│ ├── icon-512x512.png # Miruro app icon
+│ ├── favicon.ico # Classic favicon
+│ ├── apple-touch-icon-180x180.png # iOS home screen icon
+│ ├── og-image.png # OG/Twitter share image
+│ ├── privacy.html # Privacy policy (served at /privacy)
+│ └── tos.html # Terms of service (served at /tos)
+│
+├── assets/ # Scraped Miruro assets
+│ ├── favicons/ # All favicon variants
+│ ├── logos/ # Status page logo
+│ ├── fonts/ # Inter + FontAwesome
+│ └── media/ # Testimonial avatars
+│
+├── docs/ # API documentation
+│ ├── index.md # Overview, quick start, features
+│ ├── endpoints.md # Full API reference (18 endpoints)
+│ ├── streaming.md # Streaming flow guide (3-step)
+│ ├── examples.md # cURL, JavaScript, Python
+│ └── architecture.md # This file
+│
+├── src/
+│ ├── helpers/
+│ │ ├── anilist.js # AniList GraphQL integration
+│ │ ├── pipe.js # Miruro pipe integration
+│ │ └── cache.js # In-memory Map cache with TTL
+│ │
+│ └── routes/
+│ └── apiRoutes.js # All route definitions
+│
+├── test.js # Integration test suite
+├── CHANGELOG.md # Version history
+├── LICENSE # MIT License
+└── README.md # Full API documentation
+```
+
+## Tech Stack
+
+| Component | Technology |
+|-----------|------------|
+| Runtime | Node.js |
+| Framework | Express.js |
+| Metadata | AniList GraphQL (`graphql.anilist.co`) |
+| Streaming | Miruro pipe (`miruro.tv/api/secure/pipe`) |
+| Deployment | Vercel (Serverless) |
+| Caching | In-memory Map with 1-5 min TTL |
+| Static Files | Express static middleware |
+
+## Request Flow
+
+```
+Client Request
+ ↓
+Vercel Routes (/api/* → server.js)
+ ↓
+Express Router (apiRoutes.js)
+ ↓
+Helper (e.g., anilist.js or pipe.js)
+ ↓
+HTTP Request to AniList GraphQL / Miruro pipe
+ ↓
+Response decoded (base64url + gzip for pipe)
+ ↓
+Returns structured JSON
+ ↓
+Client Response
+```
+
+## Streaming Flow
+
+```
+/api/episodes/:anilistId
+ ↓
+ Returns: providers with sub/dub episode lists
+ ↓
+/api/watch/:provider/:anilistId/:category/:slug
+ ↓
+ Returns: streams[] with M3U8 URLs, quality, codec, fansub
+ ↓
+Play M3U8 in HLS player (hls.js, video.js, native)
+```
+
+## Caching Strategy
+
+- **Type:** In-memory Map
+- **TTL:** 1-5 minutes depending on endpoint
+- **Max Size:** 100 entries with FIFO eviction
+- **Key:** Full request URL
+- **Behavior:** First request fetches from source, subsequent requests served from cache
+- **Eviction:** Automatic when TTL expires or max size reached
+
+## Data Sources
+
+### AniList GraphQL
+
+- **Endpoint:** `https://graphql.anilist.co`
+- **Data:** Search, suggestions, info, characters, relations, recommendations, filter, schedule
+- **Format:** Standard GraphQL queries
+
+### Miruro Pipe
+
+- **Endpoint:** `https://miruro.tv/api/secure/pipe`
+- **Data:** Episodes, streaming sources (M3U8 URLs)
+- **Encoding:** Base64url + gzip compressed request/response
+- **Providers:** kiwi, pewe, bee, bonk, bun, ally, nun, twin, cog, moo, hop, telli
+
+## Vercel Configuration
+
+```json
+{
+ "version": 2,
+ "builds": [
+ {
+ "src": "server.js",
+ "use": "@vercel/node"
+ }
+ ],
+ "routes": [
+ {
+ "src": "/api/(.*)",
+ "dest": "server.js"
+ },
+ {
+ "src": "/(.*)",
+ "dest": "server.js"
+ }
+ ]
+}
+```
+
+- `/api/*` routes to Express for API handling
+- `/*` routes to Express for static file serving
+- Static files served from `process.cwd()` (Vercel serverless compatible)
+
+## Environment Variables
+
+| Variable | Default | Description |
+|----------|---------|-------------|
+| `PORT` | `3000` | Server port (Express mode only) |
+| `ALLOWED_ORIGINS` | `*` | Comma-separated allowed origins |
+
+## Response Format
+
+All API responses follow this structure:
+
+```json
+{
+ "success": true,
+ "results": { ... }
+}
+```
+
+Error responses:
+
+```json
+{
+ "success": false,
+ "message": "Error description"
+}
+```
+
+## Dependencies
+
+| Package | Version | Purpose |
+|---------|---------|---------|
+| express | ^4.21.0 | Web framework |
+| axios | ^1.8.0 | HTTP requests |
+| cors | ^2.8.5 | CORS headers |
+| dotenv | ^16.4.0 | Environment variables |
diff --git a/docs/endpoints.md b/docs/endpoints.md
new file mode 100644
index 0000000..536a3cd
--- /dev/null
+++ b/docs/endpoints.md
@@ -0,0 +1,375 @@
+# API Endpoints Reference
+
+Complete documentation for all 18 MiruroAPI endpoints.
+
+---
+
+## Table of Contents
+
+- [Health Check](#health-check)
+- [Stats](#stats)
+- [Search](#search)
+- [Suggestions](#suggestions)
+- [Filter](#filter)
+- [Trending](#trending)
+- [Popular](#popular)
+- [Upcoming](#upcoming)
+- [Recent](#recent)
+- [Spotlight](#spotlight)
+- [Schedule](#schedule)
+- [Anime Info](#anime-info)
+- [Characters](#characters)
+- [Relations](#relations)
+- [Recommendations](#recommendations)
+- [Episodes](#episodes)
+- [Watch (Streaming)](#watch-streaming)
+
+---
+
+## Health Check
+
+```
+GET /api/health
+```
+
+Returns API health status, version, uptime, memory usage, and available providers.
+
+**Response:**
+
+```json
+{
+ "success": true,
+ "results": {
+ "status": "healthy",
+ "version": "1.2.0",
+ "uptime": "0h 0m 34s",
+ "node": "v24.14.1",
+ "memory": { "used": "13MB", "total": "15MB" },
+ "endpoints": 16,
+ "providers": ["kiwi","pewe","bee","bonk","bun","ally","nun","twin","cog","moo","hop","telli"]
+ }
+}
+```
+
+---
+
+## Stats
+
+```
+GET /api/stats
+```
+
+Returns request statistics, cache info, and memory usage.
+
+---
+
+## Search
+
+```
+GET /api/search
+```
+
+| Param | Type | Required | Default | Description |
+|-------|------|----------|---------|-------------|
+| `query` | string | Yes | — | Search keyword |
+| `page` | number | No | 1 | Page number |
+| `per_page` | number | No | 20 | Results per page |
+
+**Example:** `GET /api/search?query=naruto&per_page=2`
+
+**Response:**
+
+```json
+{
+ "success": true,
+ "results": {
+ "page": 1,
+ "perPage": 2,
+ "total": 5000,
+ "hasNextPage": true,
+ "results": [
+ {
+ "id": 20,
+ "title": { "romaji": "NARUTO", "english": "Naruto", "native": "NARUTO -ナルト-" },
+ "coverImage": { "large": "https://s4.anilist.co/file/..." },
+ "format": "TV",
+ "episodes": 220,
+ "status": "FINISHED",
+ "averageScore": 80,
+ "genres": ["Action","Adventure","Comedy","Drama","Fantasy","Supernatural"]
+ }
+ ]
+ }
+}
+```
+
+---
+
+## Suggestions
+
+```
+GET /api/suggestions
+```
+
+| Param | Type | Required | Description |
+|-------|------|----------|-------------|
+| `query` | string | Yes | Search keyword |
+
+**Example:** `GET /api/suggestions?query=naruto`
+
+Returns fast autocomplete suggestions with title, poster, format, status, year, and episode count.
+
+---
+
+## Filter
+
+```
+GET /api/filter
+```
+
+| Param | Type | Required | Default | Description |
+|-------|------|----------|---------|-------------|
+| `genre` | string | No | — | Genre name (e.g. "Action") |
+| `tag` | string | No | — | Tag name |
+| `year` | number | No | — | Release year |
+| `season` | string | No | — | FALL, WINTER, SPRING, SUMMER |
+| `format` | string | No | — | TV, MOVIE, OVA, ONA, SPECIAL, MUSIC |
+| `status` | string | No | — | RELEASING, FINISHED, NOT_YET_RELEASED, CANCELLED |
+| `sort` | string | No | POPULARITY_DESC | Sort order |
+| `page` | number | No | 1 | Page number |
+| `per_page` | number | No | 20 | Results per page |
+
+**Example:** `GET /api/filter?genre=Action&year=2024&season=WINTER&per_page=3`
+
+---
+
+## Trending
+
+```
+GET /api/trending
+```
+
+| Param | Type | Required | Default | Description |
+|-------|------|----------|---------|-------------|
+| `per_page` | number | No | 20 | Results per page |
+
+**Example:** `GET /api/trending?per_page=5`
+
+---
+
+## Popular
+
+```
+GET /api/popular
+```
+
+| Param | Type | Required | Default | Description |
+|-------|------|----------|---------|-------------|
+| `per_page` | number | No | 20 | Results per page |
+
+---
+
+## Upcoming
+
+```
+GET /api/upcoming
+```
+
+| Param | Type | Required | Default | Description |
+|-------|------|----------|---------|-------------|
+| `per_page` | number | No | 20 | Results per page |
+
+---
+
+## Recent
+
+```
+GET /api/recent
+```
+
+| Param | Type | Required | Default | Description |
+|-------|------|----------|---------|-------------|
+| `per_page` | number | No | 20 | Results per page |
+
+---
+
+## Spotlight
+
+```
+GET /api/spotlight
+```
+
+Returns featured/spotlight anime for the hero carousel.
+
+---
+
+## Schedule
+
+```
+GET /api/schedule
+```
+
+| Param | Type | Required | Default | Description |
+|-------|------|----------|---------|-------------|
+| `date` | string | No | today | Date in YYYY-MM-DD format |
+
+---
+
+## Anime Info
+
+```
+GET /api/info/:id
+```
+
+| Param | Type | Required | Description |
+|-------|------|----------|-------------|
+| `id` | number | Yes | AniList anime ID |
+
+**Example:** `GET /api/info/20`
+
+**Response:**
+
+```json
+{
+ "success": true,
+ "results": {
+ "id": 20,
+ "idMal": 20,
+ "title": { "romaji": "NARUTO", "english": "Naruto", "native": "NARUTO -ナルト-" },
+ "description": "Naruto Uzumaki, a hyperactive and knuckle-headed ninja...",
+ "coverImage": { "large": "https://s4.anilist.co/file/..." },
+ "format": "TV",
+ "episodes": 220,
+ "duration": 23,
+ "status": "FINISHED",
+ "averageScore": 80,
+ "genres": ["Action","Adventure","Comedy","Drama","Fantasy","Supernatural"],
+ "studios": [{ "name": "Studio Pierrot", "isAnimationStudio": true }]
+ }
+}
+```
+
+---
+
+## Characters
+
+```
+GET /api/anime/:id/characters
+```
+
+| Param | Type | Required | Description |
+|-------|------|----------|-------------|
+| `id` | number | Yes | AniList anime ID |
+
+**Example:** `GET /api/anime/20/characters`
+
+Returns characters with voice actors.
+
+---
+
+## Relations
+
+```
+GET /api/anime/:id/relations
+```
+
+| Param | Type | Required | Description |
+|-------|------|----------|-------------|
+| `id` | number | Yes | AniList anime ID |
+
+Returns related anime (sequels, prequels, side stories, etc.).
+
+---
+
+## Recommendations
+
+```
+GET /api/anime/:id/recommendations
+```
+
+| Param | Type | Required | Description |
+|-------|------|----------|-------------|
+| `id` | number | Yes | AniList anime ID |
+
+Returns recommended anime based on the given ID.
+
+---
+
+## Episodes
+
+```
+GET /api/episodes/:id
+```
+
+| Param | Type | Required | Description |
+|-------|------|----------|-------------|
+| `id` | number | Yes | AniList anime ID |
+
+**Example:** `GET /api/episodes/20`
+
+**Response:**
+
+```json
+{
+ "success": true,
+ "results": {
+ "providers": {
+ "kiwi": {
+ "meta": { "id": "1571", "title": "Naruto", "type": "TV" },
+ "episodes": {
+ "sub": [
+ {
+ "id": "watch/kiwi/20/sub/animepahe-1",
+ "number": 1,
+ "title": "Enter: Naruto Uzumaki!",
+ "airDate": "2002-10-03",
+ "audio": "sub",
+ "filler": false
+ }
+ ]
+ }
+ }
+ }
+ }
+}
+```
+
+---
+
+## Watch (Streaming)
+
+```
+GET /api/watch/:provider/:anilistId/:category/:slug
+```
+
+| Param | Type | Required | Description |
+|-------|------|----------|-------------|
+| `provider` | string | Yes | Provider name (kiwi, pewe, etc.) |
+| `anilistId` | number | Yes | AniList anime ID |
+| `category` | string | Yes | sub or dub |
+| `slug` | string | Yes | Episode slug from episodes response |
+
+**Example:** `GET /api/watch/kiwi/20/sub/animepahe-1`
+
+**Response:**
+
+```json
+{
+ "success": true,
+ "results": {
+ "streams": [
+ {
+ "url": "https://vault-01.uwucdn.top/stream/.../uwu.m3u8",
+ "type": "hls",
+ "quality": "360p",
+ "resolution": { "width": 640, "height": 360 },
+ "codec": "h264",
+ "audio": "sub",
+ "fansub": "df68",
+ "referer": "https://kwik.cx/e/..."
+ }
+ ],
+ "download": "https://pahe.win/LJmbA"
+ }
+}
+```
diff --git a/docs/examples.md b/docs/examples.md
new file mode 100644
index 0000000..07751b2
--- /dev/null
+++ b/docs/examples.md
@@ -0,0 +1,267 @@
+# Code Examples
+
+All examples are tested and working with the live API.
+
+---
+
+## cURL
+
+### Search
+
+```bash
+curl "https://mirurotvapi.vercel.app/api/search?query=naruto"
+```
+
+### Suggestions
+
+```bash
+curl "https://mirurotvapi.vercel.app/api/suggestions?query=naruto"
+```
+
+### Anime Info
+
+```bash
+curl "https://mirurotvapi.vercel.app/api/info/20"
+```
+
+### Episodes
+
+```bash
+curl "https://mirurotvapi.vercel.app/api/episodes/20"
+```
+
+### Characters
+
+```bash
+curl "https://mirurotvapi.vercel.app/api/anime/20/characters"
+```
+
+### Stream URL
+
+```bash
+curl "https://mirurotvapi.vercel.app/api/watch/kiwi/20/sub/animepahe-1"
+```
+
+### Filter
+
+```bash
+curl "https://mirurotvapi.vercel.app/api/filter?genre=Action&per_page=3"
+```
+
+### Trending
+
+```bash
+curl "https://mirurotvapi.vercel.app/api/trending?per_page=5"
+```
+
+### Popular
+
+```bash
+curl "https://mirurotvapi.vercel.app/api/popular?per_page=5"
+```
+
+### Schedule
+
+```bash
+curl "https://mirurotvapi.vercel.app/api/schedule?date=2026-06-09"
+```
+
+### Health
+
+```bash
+curl "https://mirurotvapi.vercel.app/api/health"
+```
+
+---
+
+## JavaScript (Browser)
+
+### Search
+
+```javascript
+async function searchAnime(query) {
+ const res = await fetch(`https://mirurotvapi.vercel.app/api/search?query=${encodeURIComponent(query)}`);
+ const data = await res.json();
+
+ return data.results.results.map(anime => ({
+ id: anime.id,
+ title: anime.title.english || anime.title.romaji,
+ format: anime.format,
+ episodes: anime.episodes,
+ score: anime.averageScore
+ }));
+}
+
+searchAnime('naruto').then(results => {
+ results.forEach(a => console.log(`${a.title} (${a.format}) — Score: ${a.score}`));
+});
+```
+
+### Anime Info
+
+```javascript
+async function getAnimeInfo(anilistId) {
+ const res = await fetch(`https://mirurotvapi.vercel.app/api/info/${anilistId}`);
+ const data = await res.json();
+
+ const info = data.results;
+ console.log(`Title: ${info.title.english || info.title.romaji}`);
+ console.log(`Format: ${info.format}`);
+ console.log(`Status: ${info.status}`);
+ console.log(`Episodes: ${info.episodes || 'Unknown'}`);
+ console.log(`Score: ${info.averageScore}`);
+
+ return info;
+}
+
+getAnimeInfo(20);
+```
+
+### Full Streaming Flow
+
+```javascript
+async function getStreamUrl(anilistId) {
+ // Step 1: Get episodes
+ const episodesRes = await fetch(`https://mirurotvapi.vercel.app/api/episodes/${anilistId}`);
+ const episodesData = await episodesRes.json();
+ const providers = episodesData.results.providers;
+
+ const provider = Object.keys(providers)[0];
+ const episodes = providers[provider].episodes.sub;
+
+ if (!episodes || episodes.length === 0) {
+ throw new Error('No episodes found');
+ }
+
+ const episodeId = episodes[0].id;
+ const parts = episodeId.split('/');
+ const category = parts[3];
+ const slug = parts[4];
+
+ // Step 2: Get stream URLs
+ const streamRes = await fetch(`https://mirurotvapi.vercel.app/api/watch/${provider}/${anilistId}/${category}/${slug}`);
+ const streamData = await streamRes.json();
+
+ return streamData.results.streams[0].url;
+}
+
+// Usage
+getStreamUrl(20)
+ .then(url => {
+ console.log('Stream URL:', url);
+ // Use with HLS.js player
+ })
+ .catch(err => console.error('Error:', err.message));
+```
+
+### Characters
+
+```javascript
+async function getCharacters(anilistId) {
+ const res = await fetch(`https://mirurotvapi.vercel.app/api/anime/${anilistId}/characters`);
+ const data = await res.json();
+
+ return data.results.edges.map(edge => ({
+ name: edge.node.name.full,
+ role: edge.role,
+ voiceActor: edge.voiceActors[0]?.name.full || 'N/A'
+ }));
+}
+
+getCharacters(20).then(chars => {
+ chars.forEach(c => console.log(`${c.name} (${c.role}) — VA: ${c.voiceActor}`));
+});
+```
+
+---
+
+## Node.js (with axios)
+
+### Search
+
+```javascript
+const axios = require('axios');
+
+async function searchAnime(query) {
+ const { data } = await axios.get('https://mirurotvapi.vercel.app/api/search', {
+ params: { query }
+ });
+
+ return data.results.results;
+}
+
+searchAnime('naruto').then(results => {
+ results.forEach(a => console.log(`${a.title.english || a.title.romaji}`));
+});
+```
+
+### Full Streaming Flow
+
+```javascript
+const axios = require('axios');
+
+async function getStreamUrl(anilistId) {
+ const BASE = 'https://mirurotvapi.vercel.app/api';
+
+ // Step 1: Get episodes
+ const { data: episodesData } = await axios.get(`${BASE}/episodes/${anilistId}`);
+ const providers = episodesData.results.providers;
+
+ const provider = Object.keys(providers)[0];
+ const episodes = providers[provider].episodes.sub;
+
+ if (!episodes || episodes.length === 0) {
+ throw new Error('No episodes found');
+ }
+
+ const episodeId = episodes[0].id;
+ const parts = episodeId.split('/');
+ const category = parts[3];
+ const slug = parts[4];
+
+ // Step 2: Get stream URLs
+ const { data: streamData } = await axios.get(`${BASE}/watch/${provider}/${anilistId}/${category}/${slug}`);
+
+ return streamData.results.streams[0].url;
+}
+
+// Usage
+getStreamUrl(20)
+ .then(url => console.log('Stream URL:', url))
+ .catch(err => console.error('Error:', err.message));
+```
+
+### Filter by Genre
+
+```javascript
+const axios = require('axios');
+
+async function filterAnime(genre, perPage = 5) {
+ const { data } = await axios.get('https://mirurotvapi.vercel.app/api/filter', {
+ params: { genre, per_page: perPage }
+ });
+
+ return data.results.results;
+}
+
+filterAnime('Action', 3).then(anime => {
+ anime.forEach(a => console.log(`${a.title.english || a.title.romaji} (Score: ${a.averageScore})`));
+});
+```
+
+### Schedule
+
+```javascript
+const axios = require('axios');
+
+async function getSchedule(date) {
+ const { data } = await axios.get('https://mirurotvapi.vercel.app/api/schedule', {
+ params: { date }
+ });
+
+ console.log('Scheduled anime:', data.results.length);
+ return data.results;
+}
+
+getSchedule('2026-06-09');
+```
diff --git a/docs/index.md b/docs/index.md
new file mode 100644
index 0000000..6341c4a
--- /dev/null
+++ b/docs/index.md
@@ -0,0 +1,91 @@
+# MiruroAPI Documentation
+
+> Free REST API for anime streaming data. 18 endpoints, 12 providers, M3U8 URLs. No API key required.
+
+## Overview
+
+MiruroAPI is a free, open-source REST API that provides anime data by aggregating from AniList GraphQL and Miruro streaming providers. It's built with Node.js and Express, and deployed on Vercel.
+
+**Base URL:** `https://mirurotvapi.vercel.app/api`
+
+## Quick Start
+
+```bash
+# Search for anime
+curl "https://mirurotvapi.vercel.app/api/search?query=naruto"
+
+# Get anime info
+curl "https://mirurotvapi.vercel.app/api/info/20"
+
+# Get episodes
+curl "https://mirurotvapi.vercel.app/api/episodes/20"
+```
+
+**Live Response — Search:**
+
+```json
+{
+ "success": true,
+ "results": {
+ "page": 1,
+ "perPage": 20,
+ "total": 5000,
+ "hasNextPage": true,
+ "results": [
+ {
+ "id": 20,
+ "title": { "romaji": "NARUTO", "english": "Naruto" },
+ "coverImage": { "large": "https://s4.anilist.co/file/..." },
+ "format": "TV",
+ "episodes": 220,
+ "status": "FINISHED",
+ "averageScore": 80
+ }
+ ]
+ }
+}
+```
+
+## Features
+
+- **18 Endpoints** — Search, info, episodes, streaming, characters, relations, and more
+- **12 Streaming Providers** — M3U8 URLs with resolution, codec, fansub info
+- **No API Key** — Just make requests, no registration needed
+- **In-Memory Cache** — 1-5 minute TTL for fast responses
+- **CORS Enabled** — Access from any domain
+- **JSON Responses** — Standardized `{success, results}` format
+
+## Documentation
+
+- [API Endpoints Reference](endpoints.md) — Complete endpoint documentation with real responses
+- [Streaming Flow Guide](streaming.md) — How to get stream URLs step by step
+- [Code Examples](examples.md) — cURL, JavaScript, Python (all tested and working)
+- [Architecture](architecture.md) — Project structure and design decisions
+
+## Response Format
+
+All endpoints return JSON in this format:
+
+```json
+{
+ "success": true,
+ "results": { ... }
+}
+```
+
+Error responses:
+
+```json
+{
+ "success": false,
+ "message": "Error description"
+}
+```
+
+## Rate Limiting
+
+Rate limiting is enforced at 100 requests per minute per IP address. The API also uses a 1-5 minute in-memory cache. Repeated requests for the same data will be served from cache.
+
+## Disclaimer
+
+This API is for **educational purposes only**. It fetches data from AniList GraphQL and Miruro streaming providers. We are not affiliated with or endorsed by Miruro. All content belongs to its respective owners.
diff --git a/docs/streaming.md b/docs/streaming.md
new file mode 100644
index 0000000..7c9c134
--- /dev/null
+++ b/docs/streaming.md
@@ -0,0 +1,238 @@
+# Streaming Flow Guide
+
+This guide explains how to get streaming URLs from MiruroAPI in 3 steps.
+
+## Overview
+
+```
+Step 1: Get Episodes → /api/episodes/:anilistId
+Step 2: Get Stream URLs → /api/watch/:provider/:anilistId/:category/:slug
+Step 3: Play M3U8 → Use HLS player
+```
+
+---
+
+## Step 1: Get Episodes
+
+Each anime has episodes from multiple providers. Fetch the episode list with the AniList ID.
+
+**Request:**
+
+```bash
+curl "https://mirurotvapi.vercel.app/api/episodes/20"
+```
+
+**Response:**
+
+```json
+{
+ "success": true,
+ "results": {
+ "providers": {
+ "kiwi": {
+ "meta": { "id": "1571", "title": "Naruto", "type": "TV" },
+ "episodes": {
+ "sub": [
+ {
+ "id": "watch/kiwi/20/sub/animepahe-1",
+ "number": 1,
+ "title": "Enter: Naruto Uzumaki!",
+ "image": "https://image.tmdb.org/t/p/original/...",
+ "airDate": "2002-10-03",
+ "audio": "sub",
+ "filler": false
+ }
+ ]
+ }
+ }
+ }
+ }
+}
+```
+
+> **Key field:** `id` in each episode — Pass this to the next step.
+
+---
+
+## Step 2: Get Stream URLs
+
+Use the episode `id` from Step 1 to get M3U8 streaming URLs.
+
+**Request:**
+
+```bash
+curl "https://mirurotvapi.vercel.app/api/watch/kiwi/20/sub/animepahe-1"
+```
+
+**Response:**
+
+```json
+{
+ "success": true,
+ "results": {
+ "streams": [
+ {
+ "url": "https://vault-01.uwucdn.top/stream/.../uwu.m3u8",
+ "type": "hls",
+ "quality": "360p",
+ "resolution": { "width": 640, "height": 360 },
+ "codec": "h264",
+ "audio": "sub",
+ "fansub": "df68",
+ "isActive": false,
+ "referer": "https://kwik.cx/e/..."
+ }
+ ],
+ "download": "https://pahe.win/LJmbA"
+ }
+}
+```
+
+> **Done!** Use `streams[0].url` in your HLS video player.
+
+---
+
+## Step 3: Play M3U8
+
+### HLS.js (Browser)
+
+```html
+
+
+
+
+```
+
+---
+
+## JavaScript Example
+
+```javascript
+async function getStreamUrl(anilistId) {
+ // Step 1: Get episodes
+ const episodesRes = await fetch(`https://mirurotvapi.vercel.app/api/episodes/${anilistId}`);
+ const episodesData = await episodesRes.json();
+ const providers = episodesData.results.providers;
+
+ // Pick first provider with sub episodes
+ const provider = Object.keys(providers)[0];
+ const episodes = providers[provider].episodes.sub;
+
+ if (!episodes || episodes.length === 0) {
+ throw new Error('No episodes found');
+ }
+
+ // Use first episode's id
+ const episodeId = episodes[0].id; // "watch/kiwi/20/sub/animepahe-1"
+ const parts = episodeId.split('/');
+ const category = parts[3]; // "sub"
+ const slug = parts[4]; // "animepahe-1"
+
+ // Step 2: Get stream URLs
+ const streamRes = await fetch(`https://mirurotvapi.vercel.app/api/watch/${provider}/${anilistId}/${category}/${slug}`);
+ const streamData = await streamRes.json();
+
+ return streamData.results.streams[0].url; // "https://...m3u8"
+}
+
+// Usage
+getStreamUrl(20)
+ .then(url => console.log('Stream URL:', url))
+ .catch(err => console.error('Error:', err));
+```
+
+---
+
+## Python Example
+
+```python
+import requests
+
+def get_stream_url(anilist_id):
+ base = "https://mirurotvapi.vercel.app/api"
+
+ # Step 1: Get episodes
+ episodes_res = requests.get(f"{base}/episodes/{anilist_id}")
+ episodes_data = episodes_res.json()
+ providers = episodes_data['results']['providers']
+
+ # Pick first provider
+ provider = list(providers.keys())[0]
+ episodes = providers[provider]['episodes']['sub']
+
+ if not episodes:
+ raise Exception("No episodes found")
+
+ episode_id = episodes[0]['id'] # "watch/kiwi/20/sub/animepahe-1"
+ parts = episode_id.split('/')
+ category = parts[3]
+ slug = parts[4]
+
+ # Step 2: Get stream URLs
+ stream_res = requests.get(f"{base}/watch/{provider}/{anilist_id}/{category}/{slug}")
+ stream_data = stream_res.json()
+
+ return stream_data['results']['streams'][0]['url']
+
+# Usage
+url = get_stream_url(20)
+print(f"Stream URL: {url}")
+```
+
+---
+
+## Sub & Dub
+
+Providers return both `sub` and `dub` episode lists:
+
+```javascript
+const eps = await fetch("/api/episodes/20").then(r => r.json());
+const kiwi = eps.results.providers.kiwi.episodes;
+
+// Get sub episodes
+const subEps = kiwi.sub; // [{ id: "watch/kiwi/20/sub/animepahe-1", ... }]
+
+// Get dub episodes (if available)
+const dubEps = kiwi.dub; // [{ id: "watch/kiwi/20/dub/...", ... }]
+```
+
+---
+
+## Available Providers
+
+| Provider | Sub | Dub | Download | Skip Times |
+|:---|:---:|:---:|:---:|:---:|
+| kiwi | ✅ | ❌ | ✅ | ❌ |
+| pewe | ✅ | ❌ | ❌ | ❌ |
+| bee | ✅ | ✅ | ❌ | ❌ |
+| bonk | ✅ | ✅ | ✅ | ✅ |
+| bun | ✅ | ✅ | ❌ | ❌ |
+| ally | ✅ | ❌ | ✅ | ❌ |
+| nun | ✅ | ❌ | ❌ | ❌ |
+| twin | ✅ | ✅ | ❌ | ❌ |
+| cog | ✅ | ❌ | ❌ | ❌ |
+| moo | ✅ | ❌ | ✅ | ❌ |
+| hop | ❌ | ✅ | ❌ | ❌ |
+| telli | ✅ | ❌ | ❌ | ❌ |
+
+---
+
+## Troubleshooting
+
+| Issue | Solution |
+|-------|----------|
+| "No episodes found" | Check the AniList ID is correct (use `/api/search` first) |
+| "No providers" | The anime may not be available on any provider |
+| Stream URL 403 | Some servers require specific referrer headers |
+| CORS error | Use a proxy or access from server-side |
diff --git a/package.json b/package.json
index a4773b6..ab107d4 100644
--- a/package.json
+++ b/package.json
@@ -1,11 +1,11 @@
{
"name": "miruro-api",
- "version": "1.2.0",
- "description": "RESTful API for miruro.com - Anime streaming data powered by AniList GraphQL and Miruro streaming providers",
+ "version": "1.3.0",
+ "description": "RESTful API for miruro.tv - Anime streaming data powered by AniList GraphQL and Miruro streaming providers",
"main": "server.js",
"scripts": {
"start": "node server.js",
- "dev": "node server.js",
+ "dev": "nodemon server.js",
"test": "node test.js"
},
"dependencies": {
@@ -14,15 +14,25 @@
"cors": "^2.8.5",
"dotenv": "^16.4.0"
},
+ "devDependencies": {
+ "nodemon": "^3.1.0"
+ },
"keywords": [
"anime",
"api",
"miruro",
"anilist",
+ "graphql",
"streaming",
"m3u8",
- "hls"
+ "hls",
+ "rest-api",
+ "express"
],
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/Shineii86/MiruroAPI"
+ },
"author": "Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ <157171073+Shineii86@users.noreply.github.com>",
"license": "MIT"
}
diff --git a/public/404.html b/public/404.html
new file mode 100644
index 0000000..6d1eaac
--- /dev/null
+++ b/public/404.html
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+ 404 — MiruroAPI
+
+
+
+
+
+
+
+
+
+
+
+
404
+
Endpoint Not Found
+
The path you requested doesn't exist in the MiruroAPI. Check the documentation or try a valid endpoint.
+
+
HTTP 404 · Not Found
+
+
+
diff --git a/public/index.html b/public/index.html
index 97baccc..91ccfa5 100644
--- a/public/index.html
+++ b/public/index.html
@@ -1,548 +1,816 @@
-
-
+
+
+ MiruroAPI — Free Anime Streaming API
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
- MiruroAPI — Free Anime Streaming API
-
-
-
-
-
-
- MiruroAPI
-
-
-
+
+
-
-
-
-
- All systems operational
-
- MiruroAPI
- Free RESTful API for anime streaming data. 16 endpoints, 12 providers, M3U8 streaming URLs with subtitles and skip timestamps. Powered by AniList GraphQL and Miruro.
-
-
+
-
-
-
-
-
-
5000+
-
Anime Indexed
-
-
-
M3U8
-
Stream Format
+
+
+
+
+
+ Free · No API key · Open source
+ The Anime Streaming API for Your Next Project
+ Search, discover, and stream anime with M3U8 URLs. Powered by AniList GraphQL + Miruro providers. 18 endpoints, 12 providers, zero config.
+
+
+
+
+
+
+ mirurotvapi.vercel.app — API Console
+
+
+
+
// Click "Run" to see the response
+
+
+
Search
+
Trending
+
Episodes
+
Info
+
Health
+
+ Run
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Built for developers
+
Everything you need to build an anime streaming website, mobile app, or Discord bot. No API keys, no rate limits, no hassle.
+
+
+
+
+
Full-text Search
+
Search by title, synonyms, genres, tags. Get autocomplete suggestions and paginated results via AniList GraphQL.
+
+
+
+
M3U8 Streaming
+
Get direct M3U8 streaming URLs from 12 providers. Supports sub, dub, download, skip timestamps, and thumbnails.
+
+
+
+
Rich Metadata
+
Characters, staff, relations, recommendations, trailer, stats, format, status, season, episodes, and more from AniList.
+
+
+
+
Advanced Filters
+
Filter by genre, tag, year, season, format, status, sort order. Multi-select support with AniList genre IDs.
+
+
+
+
Schedule & Calendar
+
View upcoming episodes with UNIX timestamps. Perfect for building calendar views and notification systems.
+
+
+
+
Fast & Cached
+
In-memory cache with 5-minute TTL and max 100 entries. Snappy responses with reduced upstream requests.
+
+
+
+
+
+
+
+
+
+
+
Endpoints
+
All endpoints return JSON. Base URL: https://mirurotvapi.vercel.app/api
+
+
+
+
+
+
+
+
+
+
+
+
Playground
+
Test endpoints directly in your browser. No signup required.
+
+
+
+
+
+
+
+
+
+
+
Start building with MiruroAPI
+
Free, open source, no API key required. Deploy your own instance or use ours.
+
+
+
+
+
+
+
-
-
- Streaming in 3 Steps
- Get M3U8 streaming URLs for any anime episode in 3 simple API calls.
+
diff --git a/public/manifest.json b/public/manifest.json
new file mode 100644
index 0000000..fd1651c
--- /dev/null
+++ b/public/manifest.json
@@ -0,0 +1,28 @@
+{
+ "name": "MiruroAPI",
+ "short_name": "MiruroAPI",
+ "description": "Free REST API for anime streaming data. 18 endpoints, 12 providers, M3U8 URLs. No API key required.",
+ "start_url": "/",
+ "display": "standalone",
+ "id": "/",
+ "scope": "/",
+ "lang": "en",
+ "orientation": "any",
+ "background_color": "#0A0A12",
+ "theme_color": "#A855F7",
+ "icons": [
+ {
+ "src": "/icon-512x512.png",
+ "sizes": "512x512",
+ "type": "image/png",
+ "purpose": "maskable"
+ },
+ {
+ "src": "/icon-dark.svg",
+ "sizes": "any",
+ "type": "image/svg+xml",
+ "purpose": "any"
+ }
+ ],
+ "categories": ["developer", "entertainment"]
+}
diff --git a/public/privacy.html b/public/privacy.html
new file mode 100644
index 0000000..50278df
--- /dev/null
+++ b/public/privacy.html
@@ -0,0 +1,88 @@
+
+
+
+
+
+
+
+
+
+
+ Privacy Policy — MiruroAPI
+
+
+
+
+
+
+
+
+
+
+
+
Privacy Policy
+
Last updated: 2026-06-09
+
+
1. Overview
+
MiruroAPI ("the Service") is a free, open-source REST API that provides anime data by aggregating information from AniList GraphQL and Miruro streaming providers. This Privacy Policy explains how we handle data when you use the Service.
+
+
2. Data We Collect
+
The Service is designed to be stateless and privacy-preserving . We do not collect, store, or process any personal data from API consumers.
+
+ No user accounts — The API requires no authentication, registration, or API keys.
+ No cookies — We do not set tracking cookies on API responses.
+ No analytics — We do not use Google Analytics, Mixpanel, or any third-party analytics on API endpoints.
+ No logging of personal data — Server logs may contain IP addresses and request paths (standard Vercel/Node.js behavior), but these are not stored, sold, or shared.
+
+
+
3. Third-Party Data Sources
+
The Service fetches data from graphql.anilist.co (AniList) and miruro.tv (streaming providers). This data (anime titles, descriptions, images, episode information) belongs to the respective content owners. We do not claim ownership of this data.
+
If you are a content owner and wish to have your data removed from this API, please open an issue on our GitHub repository .
+
+
4. Data Storage
+
The Service uses a simple in-memory cache (1-5 minute TTL) to reduce repeated API calls. This cache is:
+
+ Purely temporary and reset on every server restart
+ Not persisted to any database
+ Not associated with any user identity
+
+
+
5. Data Sharing
+
We do not sell, trade, or share any data with third parties. The API is provided as-is for educational and development purposes.
+
+
6. Children's Privacy
+
The Service is not directed at children under 13. We do not knowingly collect information from children under 13.
+
+
7. Changes to This Policy
+
We may update this Privacy Policy from time to time. Changes will be posted on this page with an updated "Last updated" date.
+
+
8. Contact
+
For questions about this Privacy Policy, open an issue at github.com/Shineii86/MiruroAPI/issues .
+
+
+
+
diff --git a/public/robots.txt b/public/robots.txt
new file mode 100644
index 0000000..a381f40
--- /dev/null
+++ b/public/robots.txt
@@ -0,0 +1,6 @@
+# MiruroAPI — https://mirurotvapi.vercel.app
+User-agent: *
+Allow: /
+Disallow: /api
+
+Sitemap: https://mirurotvapi.vercel.app/sitemap.xml
diff --git a/public/sitemap.xml b/public/sitemap.xml
new file mode 100644
index 0000000..0345315
--- /dev/null
+++ b/public/sitemap.xml
@@ -0,0 +1,27 @@
+
+
+
+ https://mirurotvapi.vercel.app/
+ 2026-06-09
+ weekly
+ 1.0
+
+
+ https://mirurotvapi.vercel.app/api/health
+ 2026-06-09
+ daily
+ 0.9
+
+
+ https://mirurotvapi.vercel.app/privacy
+ 2026-06-09
+ monthly
+ 0.3
+
+
+ https://mirurotvapi.vercel.app/tos
+ 2026-06-09
+ monthly
+ 0.3
+
+
diff --git a/public/tos.html b/public/tos.html
new file mode 100644
index 0000000..2c86af5
--- /dev/null
+++ b/public/tos.html
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+
+
+
+
+ Terms of Service — MiruroAPI
+
+
+
+
+
+
+
+
+
+
+
+
Terms of Service
+
Last updated: 2026-06-09
+
+
1. Acceptance of Terms
+
By accessing or using MiruroAPI ("the Service"), you agree to be bound by these Terms of Service. If you do not agree, do not use the Service.
+
+
2. Description of Service
+
MiruroAPI is a free, open-source REST API that provides anime data by aggregating information from AniList GraphQL and Miruro streaming providers. The Service is provided "as is" without warranties of any kind.
+
+
3. Educational Purpose
+
The Service is built and maintained for educational and learning purposes only . It demonstrates API design, GraphQL integration, and serverless deployment techniques.
+
+
4. No Affiliation
+
The Service is not affiliated with, endorsed by, or connected to miruro.tv, Miruro, or any of its subsidiaries or affiliates. All trademarks and content belong to their respective owners.
+
+
5. Third-Party Content
+
All anime data, images, descriptions, and other content displayed through the API belong to their respective copyright holders (AniList, Miruro). The Service does not host, store, or distribute any copyrighted media.
+
+
6. Acceptable Use
+
You agree to use the Service responsibly and in compliance with all applicable laws. You must not:
+
+ Use the Service for any illegal purpose
+ Attempt to disrupt or overload the Service
+ Scrape the Service to build a competing product
+ Redistribute copyrighted content obtained through the Service
+ Use the Service to infringe on the rights of others
+
+
+
7. Rate Limiting
+
The Service uses in-memory caching with configurable TTL. Rate limiting is enforced at 100 requests per minute per IP address. Exceeding this limit will result in a 429 status code.
+
+
8. Availability
+
The Service is hosted on Vercel's free tier and may experience downtime. We do not guarantee 100% availability. The Service may be modified, updated, or discontinued at any time without notice.
+
+
9. Limitation of Liability
+
In no event shall the creators of MiruroAPI be liable for any indirect, incidental, special, consequential, or punitive damages arising from your use of the Service.
+
+
10. Intellectual Property
+
The source code of MiruroAPI is open source and available on GitHub under the repository's license terms.
+
+
11. DMCA / Takedowns
+
If you believe your copyrighted content is being displayed through this API without authorization, please open an issue at github.com/Shineii86/MiruroAPI/issues and we will promptly remove it.
+
+
12. Changes to Terms
+
We reserve the right to modify these Terms at any time. Changes will be posted on this page with an updated "Last updated" date.
+
+
13. Contact
+
For questions about these Terms, open an issue at github.com/Shineii86/MiruroAPI/issues .
+
+
+
+
diff --git a/render.yaml b/render.yaml
new file mode 100644
index 0000000..188b1d0
--- /dev/null
+++ b/render.yaml
@@ -0,0 +1,9 @@
+services:
+ - type: web
+ name: MiruroAPI
+ env: node
+ buildCommand: npm install
+ startCommand: npm start
+ envVars:
+ - key: ALLOWED_ORIGINS
+ value: https://miruro.tv,https://miruro.to,https://miruro.bz,https://miruro.ru
diff --git a/server.js b/server.js
index 3767fb0..20c8af0 100644
--- a/server.js
+++ b/server.js
@@ -70,13 +70,29 @@ app.use((req, res, next) => {
app.use(express.static(path.join(__dirname, "public"), { redirect: false }));
+// ══════════════════════════════════════════════════════════════
+// CLEAN URL ROUTES
+// ══════════════════════════════════════════════════════════════
+
+// ---- FEATURE: Clean URL routes (no .html extension) ----
+const fs = require("fs");
+const publicDir = path.join(__dirname, "public");
+
+app.get("/tos", (req, res) => {
+ res.sendFile(path.join(publicDir, "tos.html"));
+});
+
+app.get("/privacy", (req, res) => {
+ res.sendFile(path.join(publicDir, "privacy.html"));
+});
+
// ══════════════════════════════════════════════════════════════
// SWAGGER UI DOCS
// ══════════════════════════════════════════════════════════════
// ---- FEATURE: Interactive Swagger UI documentation at /docs ----
app.get("/docs", (req, res) => {
- res.sendFile(path.join(__dirname, "public", "docs.html"));
+ res.sendFile(path.join(publicDir, "docs.html"));
});
// ══════════════════════════════════════════════════════════════
@@ -163,7 +179,11 @@ app.use((req, res) => {
message: "Endpoint not found",
});
}
- res.sendFile(path.join(__dirname, "public", "index.html"));
+ const notFoundPath = path.join(publicDir, "404.html");
+ if (fs.existsSync(notFoundPath)) {
+ return res.status(404).sendFile(notFoundPath);
+ }
+ res.sendFile(path.join(publicDir, "index.html"));
});
// ══════════════════════════════════════════════════════════════
diff --git a/test.js b/test.js
new file mode 100644
index 0000000..686fb3d
--- /dev/null
+++ b/test.js
@@ -0,0 +1,74 @@
+/*
+ * ======= • ======= • ======= • ======= • =======• =======
+ * MiruroAPI — test.js
+ * Repository: https://github.com/Shineii86/MiruroAPI
+ *
+ * @description
+ * Integration test suite for MiruroAPI endpoints.
+ * Tests all major endpoints for correct response format.
+ *
+ * @author Shinei Nouzen
+ * @license MIT
+ * ======= • ======= • ======= • ======= • =======• =======
+ */
+
+const BASE = process.env.API_URL || "https://mirurotvapi.vercel.app/api";
+
+const tests = [
+ { name: "Health", url: "/health" },
+ { name: "Stats", url: "/stats" },
+ { name: "OpenAPI", url: "/openapi" },
+ { name: "Search", url: "/search?query=naruto" },
+ { name: "Suggestions", url: "/suggestions?query=naruto" },
+ { name: "Filter", url: "/filter?genre=Action&per_page=1" },
+ { name: "Trending", url: "/trending?per_page=1" },
+ { name: "Popular", url: "/popular?per_page=1" },
+ { name: "Upcoming", url: "/upcoming?per_page=1" },
+ { name: "Recent", url: "/recent?per_page=1" },
+ { name: "Spotlight", url: "/spotlight" },
+ { name: "Schedule", url: "/schedule" },
+ { name: "Info", url: "/info/20" },
+ { name: "Characters", url: "/anime/20/characters" },
+ { name: "Relations", url: "/anime/20/relations" },
+ { name: "Recommendations", url: "/anime/20/recommendations" },
+ { name: "Episodes", url: "/episodes/20" },
+ { name: "Watch", url: "/watch/kiwi/20/sub/animepahe-1" },
+];
+
+let passed = 0;
+let failed = 0;
+
+async function runTest(test) {
+ try {
+ const res = await fetch(`${BASE}${test.url}`);
+ if (!res.ok) {
+ console.log(`❌ ${test.name} - HTTP ${res.status}`);
+ failed++;
+ return;
+ }
+ const data = await res.json();
+ if (data.success === true && data.results) {
+ console.log(`✅ ${test.name}`);
+ passed++;
+ } else {
+ console.log(`❌ ${test.name} - Invalid response format`);
+ failed++;
+ }
+ } catch (error) {
+ console.log(`❌ ${test.name} - ${error.message}`);
+ failed++;
+ }
+}
+
+async function runAll() {
+ console.log(`\n🧪 Running ${tests.length} tests...\n`);
+
+ for (const test of tests) {
+ await runTest(test);
+ }
+
+ console.log(`\n📊 Results: ${passed} passed, ${failed} failed, ${tests.length} total\n`);
+ process.exit(failed > 0 ? 1 : 0);
+}
+
+runAll();