This project is a backend application that provides APIs for managing YouTube Subscibers.
We have to create a backend api which will send the response in form of JSON, by using modular coding approach which contains having different files for the api connection, the database should be handled by another file.
The APIs provided by this application include the following:
✅GET [http://localhost:3000/subscribers] - Response with an array of subscribers(an Object).
✅GET [http://localhost:3000/subscribers/names] - Response with an array of subscribers(an Object with only two fields name and subscribedChannel).
✅GET [http://localhost:3000/subscribers/:id] - Response with a subscriber*(an object)* with given id & Response with status code 400 and Error message({message: error.message}) if id does not match.
Before running this application, you must have the following softwares:
Node.js https://nodejs.org/en
MongoDB https://www.mongodb.com/try/download/shell
- To run this project locally, use the following command in your CLI:
- Clone this repository:
git clone https://github.com/SakshamAgrawall/Get_Youtube_subscribers.git
- Install dependencies:
npm i
-
Create a .env file and add monogodb uri
-
Create a database:
cd src
node createDatabase.js
- Start the application:
npm run start
- Go to any Browser and search localhost:3000
- User can get the all subscribers.
- User can get the all subscriber with only name and subscribedchannel.
- user can get the subscriber by id.
MongoDB | Nodejs | express | Mongoose
This capstone project is associated with Almabetter