birds-of-margarita-rest

This project was created using:

  • JavaScript
  • NodeJs
  • ExpressJs
  • Express-session
  • SqLite
  • PostgreSQL
  • dotenv
  • Helmet
  • Cors

How to use:

For Developers

Donwload the project and install dependecies with npm i the run npm run develop or npm start

Common users:

Donwload Postman or Insomnia

Or go to reqbin.com, and download its extension

  1. You have to register to see what the api offers.

https://birds-margarita.herokuapp.com/api/auth/register

Post:

{
	"username": "Isaac",
	"password": "314"
}
  1. Then, login.

https://birds-margarita.herokuapp.com/api/auth/login

Post:

{
	"username": "Isaac",
	"password": "314"
}

You can logout easily accesing to https://birds-margarita.herokuapp.com/api/auth/logout

  1. Check all users in the API and their password (encrypted)

https://birds-margarita.herokuapp.com/api/users/

3.5) Chack info of a single user. Write the username after user/ route.Be careful, It's case sensitive

https://birds-margarita.herokuapp.com/api/users/isaac

Birds of Margarita

  1. Check all the birds that exist in the database. You will be able to read their common name, scientific name and description.

Get:

https://birds-margarita.herokuapp.com/api/birds/

  1. Add a bird to the API. "common name" and "description" can not be null.

https://birds-margarita.herokuapp.com/api/birds/

Post:

{
	"common_name": "Aguila Calva",
	"scientific_name": "Aguilus Aguilarus",
	"description": "Vuela sobre las planicies de la peninsula de Macanao, caza ratones."	
}
  1. Check a Bird by ID. Write the ID after the birds/ route Get:

https://birds-margarita.herokuapp.com/api/birds/7

  1. Re-write bird info. Write the ID after the birds/ route Patch:

https://birds-margarita.herokuapp.com/api/birds/7

{
	"common_name": "Aguila Espartana",
	"scientific_name": "Aguilaris Espartanus",
	"description": "Vuela bajo, cazando todo tipo de animales."	
}
  1. Delete bird info. Write the ID after the birds/ route Delete:

https://birds-margarita.herokuapp.com/api/birds/7

Observation of birds:

  1. If you want to add an observation about a bird. Write the ID of the bird after the birds/ route and before /observation (Must provide "watcher" and "observation" fields):

https://birds-margarita.herokuapp.com/api/birds/7/observations

Post:

{
	"watcher": "Isaac",
	"observation": "Observé una bandada en Porlamar"
}
  1. Get all the observations about a bird . Write the ID of the bird after the birds/ route and before /observations:

Get:

https://birds-margarita.herokuapp.com/api/birds/7/observations

  1. Delete observation. Write the ID of the observation after /observations route:

Delete:

https://birds-margarita.herokuapp.com/api/observations/7/