Skip to content
Snippets Groups Projects
Commit c08fae68 authored by Johannes Borgen's avatar Johannes Borgen
Browse files

finsihed adding examples

parent cbc884f5
No related branches found
No related tags found
No related merge requests found
......@@ -15,33 +15,39 @@ This endpoint returns a list of different routes it takes can take 2 parameters
If they are not specified it wil set limit to 20 and it wont skip (start at 0)
The endpoint can be reached by a get request to <code>/altocumulus/v1/turer</code>
example: http://10.212.137.140:8080/altocumulus/v1/turer/?limit=5&skip=200
## Tur
This endpoint can be reached at <code>/altocumulus/v1/tur/524081f9b8cb77df150007fa</code>.
The string at the end is the id of the trip and can be replaced with any other valid id gotten from for example the turer endpoint
The endpoint provides more information about the route as well as weatherforecast and reviews stored in the database.
example: http://10.212.137.140:8080/altocumulus/v1/tur/524081f9b8cb77df150007fa
## Review
<code>../altocumulus/v1/review</code>
#### Get
By sending a Get request to the endpoint you wil get all a list of all the reviews from the database.
example: http://10.212.137.140:8080/altocumulus/v1/tur/524081f9b8cb77df150007fa
example: http://10.212.137.140:8080/altocumulus/v1/review/
#### Post
By sending a Post request with a payload you can add a review to the database. Example payload:
<code> {"navn": "Andre", "turid": "524081f9b8cb77df150007fa", "beskrivelse": "Dette var en fin tur", "terningkast": 5} </code>
Navn, turid and beskrivelse has to be a string and terningkast has to be a number between 1 and 6. If you add a review
to the database it wil respond with the reviewID, this can be used to delete.
Use this url with payload and POST: http://10.212.137.140:8080/altocumulus/v1/review/
#### Delete
By sending a Delete request to <code>/altocumulus/v1/review/"ID"</code>, Where id is the string returned in the post endpoint wil delete the review from the Database
By sending a Delete request to http://10.212.137.140:8080/altocumulus/v1/review/"ID"</code>, Where id is the string returned in the post endpoint wil delete the review from the Database
## Weather
The weather functions supplements a forecast to a specific tur from /tur endpoint, including temperatures and a listing of rain occurences in a 9 day timeperiod.
The data is derived from Metrologisk institutt (MET) and is under creative common license (https://creativecommons.org/licenses/by/4.0/).
<code>../altocumulus/v1/weather?lat="float64"&long="float64""</code>
### GET
By sending a GET request to the weather endpoint with valid float64 values for latitude and longitude you can get a forecast for a specific location by coordinates.
example: http://10.212.137.140:8080/altocumulus/v1/weather/?lat=6.28295153901365&long=58.8226193213945
# Deployment
## Docker
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment