Skip to content

cnizo/distance-calculator

Repository files navigation

Distance calculator application

Submit a source and a destination address and get the distance in kilometers between them.

Description

This app was implemented using Nest framework and it was deployed on Deta Cloud;

It is connected to a MongoDb database hosted on MongoDB Atlas.

Running the app

This project uses Docker and docker-compose for local development.

If you are running it for the first time, run in the project root:

$ docker-compose up --build

If not, just run:

$ docker-compose up

The app will be available on localhost:3000.

Using the app

Calculate a distance

In order to search for the distance between two addresses, fill the form and sumbit.

The result will appear on a dialog box.

Get historical queries

In order to get historical queries, access /search, for example localhost:3000/search

PS: Only queries with both source and destination addresses are stored. Queries that had both addresses but no distance calculated are stored without a distance value.

Test

With the container running, run in another terminal window:

$ docker-compose exec app npm run test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published