Coder Social home page Coder Social logo

wowgeekyboy / distance Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 360 KB

๐Ÿ“ This project implements an API endpoint that accepts a pair of city names as input and returns the travel distance (not straight-line distance) between these cities, sub-cities, or localities.

Home Page: https://distance-lemon.vercel.app

Procfile 0.26% HTML 23.16% CSS 8.56% JavaScript 68.03%

distance's Introduction

City Distance API ๐Ÿ“

This project implements an API endpoint that accepts a pair of city names as input and returns the travel distance (not straight-line distance) between these cities, sub-cities, or localities.

Expected Solution

You are expected to share a hosted, working GET endpoint and an API contract for the same.

Additional Information

  • Choice of backend stack is up to you.
  • Additional points for building a front-end where you can enter the city names and it shows the distance. You can choose to host it locally and expose it via ngrok for testing.
  • Feel free to use any free-tier hosting. Locally hosted endpoints are okay but not desirable.
  • Feel free to integrate with any third-party maps provider to fetch this information.
  • You would be judged on extensibility, modularity, and code quality.
  • Code with test cases is a huge plus.

API Endpoint

The API endpoint accepts a pair of city names as input and returns the distance between them.

API Contract

  • Endpoint: /api/distance
  • Method: GET
  • Request Parameters:
    • city1: The name of the first city
    • city2: The name of the second city
  • Response Format: JSON
  • Example Response:
    {
      "distance": "1,080.7 km"
    }
    

Getting Started

  • Installation
  • Clone the repository: git clone https://github.com/isarvesh/distance.git
  • Navigate to the project directory: cd distance
  • Install dependencies: npm install
  • Start the development server: npm run dev

Front-end

To test the API and view the distance between cities, you can visit the hosted front-end.

Hosted Front-end: https://distance-lemon.vercel.app/

License This project is licensed under the MIT License.

distance's People

Contributors

wowgeekyboy avatar

Watchers

 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.