Giter VIP home page Giter VIP logo

finderly-api's Introduction

Finderly API

Design a RESTful API which can collect the information on the different locations for us and also determine the distance between the locations and a configurable location which can be changed or supplied. The formula for calculating distance between two points can be gotten here https://en.wikipedia.org/wiki/Great-circle_distance.

Documentation

https://documenter.getpostman.com/view/6765162/TzeZES2H

Getting Started

Prerequisites

Ensure you have the following installed on your local machine:

Installing/Run locally

  • Make sure you have nodejs, postgres installed.

  • install nestJs global

      - npm i -g @nestjs/cli
  • Clone or fork repo🤷‍♂

      - git clone https://github.com/RIDUMATICS/finderly-api.git
      - cd finderly-api
      - npm install
  • Create a PostgreSQL database by running the command below in psql

      createdb -h localhost -p 5432 -U postgres finderly_db
  • Create/configure .env environment with your credentials. A sample .env.example file has been provided to get you started. Make a duplicate of .env.example and rename to .env, then configure your credentials.

  • Run npm run start:dev to start the server and watch for changes

Testing

  • Run npm run test to performs a single full test suite run

API ENDPOINTS

URI HTTP Method Description
/api/v1/locations POST Create a new location
/api/v1/locations GET Fetch all locations
/api/v1/locations/:id GET Fetch a single location by id
/api/v1/locations/distance?locationA=New York&locationB=London GET Calculate distance
/api/v1/locations/:id UPDATE Update a single location by id
/api/v1/locations/:id DELETE Delete a single location by id

Misc😏

If for some reason you find this repo useful, please give me a star🙏

finderly-api's People

Contributors

ridumatics avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.