rishwi17 / Locations_API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Locations API

Operations included :

  • Create a new Location(POST '/')
  • View all locations(GET '/')
  • View a particular locations(GET '/:locationId')
  • Update a location(PATCH '/:locationId')
  • Delete a location(DELETE '/:locationId')
  • Use the POST '/login' route to login and use the endpoints using the following exact request body for the test user to generate the JWT:
    { "name" : "user", "password" : "password" }

    Copy the token into the authorization section of the request header as :

    "Bearer {tokenID}"

    To create a new entry in the DB use the following format for the request body along with the POST '/' route:
    { name : "Hyderabad", latitude : "161668", longitude : "16486", city : "Hyderabad", country : "India", locationImage : {image}, timeToVisit : ["June to July","November to January"]

    }

  • Use the command : npm install to install the dependencies
  • Use the command : npm run dev to run the project with nodemon
  • About


    Languages

    Language:JavaScript 100.0%