Welcome to Youtube Subscribers fetch portal by Kamran
The API provided by this application contains the url as following below :
- Base URL :http://localhost:3000
- GET /subscribers : returns an array of
subscribers
present in database.
- GET /subscribers/names : returns an array of
subscribers with only two fields (name & subscribedChannel).
- GET /subscribers/:id : returns the details of a
subscriber with given ID.
- If ":id" in /subscribers/:id is not found in
database
then it returns with an error message with a status code of 400.
**Kindly note**
Base URL only works if running this application with the local directory. Once deployed over cloud (i.e
Vercel), Base URL will be changed & rest relative url of api remains same.
- Use JSON Viewer extension to view clean in browser
Add and delete subscribers using url as below:
- POST /subscribers/add : adds new subscriber to
the database.
- DELETE /subscribers/delete/:id : deletes a
subscriber from the database.