Skip to content

dmonay/okra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A RESTful Go server to authenticate users and store TODO tasks in a DB

This service responds to requests to calculate the straight-line distance between two sets of coordinates.

##Dependencies

Data Stores

  • MySQL

Installation/Set up

In your project directory, you can run

go get github.com/dmonay/worth_my_salt

Tests and Benchmarks

To run tests, run

go test

To run benchmarks, run

go test -check.b

Documentation

Getting distance

POST /distance

Sample Request Body

{
"lat1":"39.768434", 
"lon1":"-104.901872", 
"lat2":"44.7793732", 
"lon2":"-69.6734886", 
"unit":"km"
}

NOTE: Units MUST be one of "mi", "miles", "km", or "kilometers".

Sample Response Body

{
   "Success":"You have 2927.7229366372153 km to travel."
}