docs: reverted json response schema to js & updated local installation guide

This commit is contained in:
Ritesh Ghosh
2023-08-07 14:18:37 +05:30
parent 663d5761d6
commit f52dc709da
+201 -198
View File
@@ -62,7 +62,7 @@
## Table of Contents ## Table of Contents
- [Installation](#installation) - [Installation](#installation)
- [Local Installation](#local-installation) - [Local](#local)
- [Documentation](#documentation) - [Documentation](#documentation)
- [GET Anime Home Page](#get-anime-home-page) - [GET Anime Home Page](#get-anime-home-page)
- [GET Anime About Info](#get-anime-about-info) - [GET Anime About Info](#get-anime-about-info)
@@ -75,21 +75,24 @@
## <span id="installation">💻 Installation</span> ## <span id="installation">💻 Installation</span>
### Local Installation ### Local
1. Run the following command to clone the repository and install the dependencies. 1. Clone the repository and move into the directory.
```bash ```bash
git clone https://github.com/ghoshRitesh12/zoro.to-api.git git clone https://github.com/ghoshRitesh12/zoro.to-api.git
cd zoro.to-api cd zoro.to-api
```
2. Install all the dependencies.
```bash
npm ci #or yarn install npm ci #or yarn install
``` ```
2. Rename the `.env.example` file to `.env` and update any details required 3. Rename the `.env.example` file to `.env` and update any details required.
3. Start the server! 4. Start the server!
```bash ```bash
npm start #or yarn start npm start #or yarn start
@@ -117,83 +120,83 @@ console.log(data);
#### Response Schema #### Response Schema
```json ```javascript
{ {
"genres": ["Action", "Cars", "Adventure", ...], genres: ["Action", "Cars", "Adventure", ...],
"latestEpisodeAnimes": [ latestEpisodeAnimes: [
{ {
"id": "string", id: string,
"name": "string", name: string,
"poster": "string", poster: string,
"duration": "string", duration: string,
"type": "string", type: string,
"rating": "string", rating: string,
"episodes": { episodes: {
"sub": "number", sub: number,
"dub": "number", dub: number,
} }
}, },
{...}, {...},
], ],
"spotlightAnimes": [ spotlightAnimes: [
{ {
"id": "string", id: string,
"name": "string", name: string,
"jname": "string", jname: string,
"poster": "string", poster: string,
"description": "string", description: string,
"rank": "number", rank: number,
}, },
{...}, {...},
], ],
"top10Animes": { top10Animes: {
"today": [ today: [
{ {
"episodes": { episodes: {
"sub": "number", sub: number,
"dub": "number", dub: number,
}, },
"id": "string", id: string,
"name": "string", name: string,
"poster": "string", poster: string,
"rank": "number" rank: number
}, },
{...}, {...},
], ],
"month": [...], month: [...],
"week": [...] week: [...]
}, },
"topAiringAnimes": [ topAiringAnimes: [
{ {
"id": "string", id: string,
"name": "string", name: string,
"jname": "string", jname: string,
"poster": "string", poster: string,
}, },
{...}, {...},
], ],
"topUpcomingAnimes": [ topUpcomingAnimes: [
{ {
"id": "string", id: string,
"name": "string", name: string,
"poster": "string", poster: string,
"duration": "string", duration: string,
"type": "string", type: string,
"rating": "string", rating: string,
"episodes": { episodes: {
"sub": "number", sub: number,
"dub": "number", dub: number,
} }
}, },
{...}, {...},
], ],
"trendingAnimes": [ trendingAnimes: [
{ {
"id": "string", id: string,
"name": "string", name: string,
"poster": "string", poster: string,
"rank": "number", rank: number,
"}," },
{...}, {...},
], ],
} }
@@ -223,85 +226,85 @@ console.log(data);
#### Response Schema #### Response Schema
```json ```javascript
{ {
"anime": [ anime: [
"info": { info: {
"id": "string", id: string,
"name": "string""," name: string,
"poster": "string", poster: string,
"description": "string", description: string,
"stats": { stats: {
"rating": "string", rating: string,
"quality": "string", quality: string,
"episodes": { episodes: {
"sub": "number", sub: number,
"dub": "number" dub: number
}, },
"type": "string", type: string,
"duration": "string" duration: string
} }
} }
"moreInfo": { moreInfo: {
"aired": "string", aired: string,
"genres": ["Action", "Mystery", ...], genres: ["Action", "Mystery", ...],
"status": "string", status: string,
"studios": "string", studios: string,
"duration": "string" duration: string
... ...
} }
], ],
"mostPopularAnimes": [ mostPopularAnimes: [
{ {
"episodes": { episodes: {
"sub": "number", sub: number,
"dub": "number", dub: number,
}, },
"id": "string", id: string,
"jname": "string", jname: string,
"name": "string", name: string,
"poster": "string", poster: string,
"type": "string" type: string
}, },
{...}, {...},
], ],
"recommendedAnimes": [ recommendedAnimes: [
{ {
"id": "string", id: string,
"name": "string", name: string,
"poster": "string", poster: string,
"duration": "string", duration: string,
"type": "string", type: string,
"rating": "string", rating: string,
"episodes": { episodes: {
"sub": "number", sub: number,
"dub": "number", dub: number,
} }
}, },
{...}, {...},
], ],
"relatedAnimes": [ relatedAnimes: [
{ {
"id": "string", id: string,
"name": "string", name: string,
"poster": "string", poster: string,
"duration": "string", duration: string,
"type": "string", type: string,
"rating": "string", rating: string,
"episodes": { episodes: {
"sub": "number", sub: number,
"dub": "number", dub: number,
} }
}, },
{...}, {...},
], ],
"seasons": [ seasons: [
{ {
"id": "string", id: string,
"name": "string", name: string,
"title": "string", title: string,
"poster": "string", poster: string,
"isCurrent": "boolean" isCurrent: boolean
}, },
{...} {...}
] ]
@@ -316,10 +319,10 @@ console.log(data);
#### Query Parameters #### Query Parameters
| Parameter | Type | Description | Required? | Default | | Parameter | Type | Description | Required? | Default |
| :-------: | :------: | :---------------------------------------------------------------: | :-------: | :-----: | | :-------: | :----: | :---------------------------------------------------------------: | :-------: | :-----: |
| `q` | "string" | The search query, i.e. the title of the item you are looking for. | Yes | -- | | `q` | string | The search query, i.e. the title of the item you are looking for. | Yes | -- |
| `page` | number | The page number of the result. | No | `1` | | `page` | number | The page number of the result. | No | `1` |
#### Request sample #### Request sample
@@ -331,40 +334,40 @@ console.log(data);
#### Response Schema #### Response Schema
```json ```javascript
{ {
"animes": [ animes: [
{ {
"id": "string", id: string,
"name": "string", name: string,
"poster": "string", poster: string,
"duration": "string", duration: string,
"type": "string", type: string,
"rating": "string", rating: string,
"episodes": { episodes: {
"sub": "number", sub: number,
"dub": "number", dub: number,
} }
}, },
{...}, {...},
], ],
"mostPopularAnimes": [ mostPopularAnimes: [
{ {
"episodes": { episodes: {
"sub": "number", sub: number,
"dub": "number", dub: number,
}, },
"id": "string", id: string,
"jname": "string", jname: string,
"name": "string", name: string,
"poster": "string", poster: string,
"type": "string" type: string
}, },
{...}, {...},
], ],
"totalPages": 1, totalPages: 1,
"currentPage": 1, currentPage: 1,
"hasNextPage": false hasNextPage: false
} }
``` ```
@@ -376,9 +379,9 @@ console.log(data);
#### Path Parameters #### Path Parameters
| Parameter | Type | Description | Required? | Default | | Parameter | Type | Description | Required? | Default |
| :-------: | :------: | :----------------------: | :-------: | :-----: | | :-------: | :----: | :----------------------: | :-------: | :-----: |
| `name` | "string" | The name of anime genre. | Yes | -- | | `name` | string | The name of anime genre. | Yes | -- |
#### Query Parameters #### Query Parameters
@@ -396,42 +399,42 @@ console.log(data);
#### Response Schema #### Response Schema
```json ```javascript
{ {
"animes": [ animes: [
{ {
"id": "string", id: string,
"name": "string", name: string,
"poster": "string", poster: string,
"duration": "string", duration: string,
"type": "string", type: string,
"rating": "string", rating: string,
"episodes": { episodes: {
"sub": "number", sub: number,
"dub": "number", dub: number,
} }
}, },
{...}, {...},
], ],
"genreName": "string", genreName: string,
"genres": ["Action", "Cars", "Adventure", ...] genres: ["Action", "Cars", "Adventure", ...]
"topAiringAnimes": [ topAiringAnimes: [
{ {
"episodes": { episodes: {
"sub": "number", sub: number,
"dub": "number", dub: number,
}, },
"id": "string", id: string,
"jname": "string", jname: string,
"name": "string", name: string,
"poster": "string", poster: string,
"type": "string" type: string
}, },
{...}, {...},
], ],
"totalPages": 38, totalPages: 38,
"currentPage": 2, currentPage: 2,
"hasNextPage": true hasNextPage: true
} }
``` ```
@@ -443,9 +446,9 @@ console.log(data);
#### Path Parameters #### Path Parameters
| Parameter | Type | Description | Required? | Default | | Parameter | Type | Description | Required? | Default |
| :--------: | :------: | :--------------------: | :-------: | :-----: | | :--------: | :----: | :--------------------: | :-------: | :-----: |
| `category` | "string" | The category of anime. | Yes | -- | | `category` | string | The category of anime. | Yes | -- |
#### Query Parameters #### Query Parameters
@@ -463,45 +466,45 @@ console.log(data);
#### Response Schema #### Response Schema
```json ```javascript
{ {
"animes": [ animes: [
{ {
"id": "string", id: string,
"name": "string", name: string,
"poster": "string", poster: string,
"duration": "string", duration: string,
"type": "string", type: string,
"rating": "string", rating: string,
"episodes": { episodes: {
"sub": "number", sub: number,
"dub": "number", dub: number,
} }
}, },
{...}, {...},
], ],
"category": "string", category: string,
"genres": ["Action", "Cars", "Adventure", ...] genres: ["Action", "Cars", "Adventure", ...]
"top10Animes": { top10Animes: {
"today": [ today: [
{ {
"episodes": { episodes: {
"sub": "number", sub: number,
"dub": "number", dub: number,
}, },
"id": "string", id: string,
"name": "string", name: string,
"poster": "string", poster: string,
"rank": "number" rank: number
}, },
{...}, {...},
], ],
"month": [...], month: [...],
"week": [...] week: [...]
}, },
"totalPages": 100, totalPages: 100,
"currentPage": 2, currentPage: 2,
"hasNextPage": true hasNextPage: true
} }
``` ```