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.
https://hack2skilltask-2.onrender.com
- Clone the repository: git clone https://github.com/your-username/library-app.git
Before running the application, make sure you have the following installed:
- Node.js
- MongoDB
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"
},
npm run start
The server will start running on the specified port.
- 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
- 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
- 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
mongoURL
port
key1
key2