/task-2

Primary LanguageJavaScript

task-2

To make an API to fetch latest videos sorted in reverse chronological order of their publishing date-time from YouTube for a given tag/search query in a paginated response.

Backend

Backend-Link:-

https://hack2skilltask-2.onrender.com

Installation

  1. Clone the repository: git clone https://github.com/your-username/library-app.git

Pre - requisites

Before running the application, make sure you have the following installed:

  • Node.js
  • MongoDB

Install the dependencies:

npm install
 "dependencies": {
"cors": "^2.8.5",
"dotenv": "^16.3.1",
"express": "^4.18.2",
"googleapis": "^122.0.0",
"mongoose": "^7.3.4",
"nodemon": "^3.0.1"

},

Start the server:

 npm run start

The server will start running on the specified port.

API Endpoint

  1. to get all data regarding cricket
* method : GET
* Endpoint : /videos


* Response:
  200 OK: all available data of cricket.
  500 Internal Server Error: Error fetching latest videos
  1. to get all paginated data regarding cricket
* method : GET
* Endpoint : /videos?page=<pageno.>&limit=<limitno.>


* Response:
  200 OK: paginated available data of football.
  500 Internal Server Error: Error fetching latest videos
  1. to get all data regarding cricket by search with title and description
* method : GET
* Endpoint : /search?q=<title or description>


* Response:
  200 OK: all available data of cricket according to search.
  500 Internal Server Error: Error fetching latest videos

Tech Stacks

Backend



Environment Variables

mongoURL

port

key1

key2