Στο αρχείο umbrellapp files υπάρχει το αρχείο umbrellapp.sql. Δημιουργεί την βάση με τις κατάλληλες εγγραφές. Το default username και password για την βάση είναι root και '', τα οποία μπορούν να αλλάξουν από το config/database.
Returns json data about a given city name
-
URL
/searchCityName/:name
-
Method:
GET
-
URL Params
Required:
name=[string]
-
Data Params
None
-
Success Response:
- Code: 200
Content:[ { "id": 264371, "name": "Athens", "country": "GR", "lat": "23.71622", "lon": "37.97945" } ]
- Code: 200
-
Error Response:
-
Code: 404 NOT FOUND
Content:{ "status": "city not found" }
OR
-
Code: 422 UNPROCESSABLE ENTITY
Content:{ "status": "name is missing" }
-
Returns json data about a city by given coordinates
-
URL
/searchCityByCoords/:lat/:lng
-
Method:
GET
-
URL Params
Required:
lat=[float]
lng=[float]
-
Data Params
None
-
Success Response:
- Code: 200
Content:[ { "id": 264371, "name": "Athens", "country": "GR", "lat": "23.71622", "lon": "37.97945" } ]
- Code: 200
-
Error Response:
-
Code: 404 NOT FOUND
Content:{ "status": "city not found" }
OR
-
Code: 422 UNPROCESSABLE ENTITY
Content:{ "status": "data are missing" }
-
Save favourite city by id
-
URL
/saveFavouriteCity
-
Method:
POST
-
URL Params
None
-
Data Params
Payload:
{ "id": [integer] }
Example:
{ "id": 264371 }
-
Success Response:
- Code: 200
Content:{ "status": "favourite city inserted" }
- Code: 200
-
Error Response:
-
Code: 409 CONFLICT
Content:{ "status": "city is already in favourite list" }
OR
-
Code: 422 UNPROCESSABLE ENTITY
Content:{ "id": ["id is missing"] }
-
Returns json data about favourite cities
-
URL
/showFavouriteCities
-
Method:
GET
-
URL Params
None
-
Data Params
None
-
Success Response:
- Code: 200
Content:[ { "id": 264371, "name": "Athens", "country": "GR", "lat": "23.71622", "lon": "37.97945", "country_name": "Greece" } ]
- Code: 200
-
Error Response:
- Code: 500 INTERNAL SERVER ERROR
Content:{ "status": "an error occurred while retrieving favourite cities" }
- Code: 500 INTERNAL SERVER ERROR
Delete favourite city by id
-
URL
/deleteFavouriteCity
-
Method:
DELETE
-
URL Params
Required:
id=[integer]
-
Data Params
None
-
Success Response:
- Code: 200
Content:{ "status": "favourite city deleted" }
- Code: 200
-
Error Response:
-
Code: 404 NOT FOUND
Content:{ "status": "city not found" }
OR
-
Code: 422 UNPROCESSABLE ENTITY
Content:{ "status": "id is missing" }
-
Returns json data about a city forecast
-
URL
/getForecast/:id/:date
-
Method:
GET
-
URL Params
Required:
id=[integer]
date=[timestamp]]
-
Data Params
None
-
Success Response:
- Code: 200
Content:{ "id": 2225, "time": "2014-03-15 06:26:10", "temperatures": [ { "id": 36162, "dt": "2014-03-15 10:00:00", "temperature": { "id": 36162, "min": 276.15, "max": 289.15 } } ], "weathers": [ { "id": 36162, "dt": "2014-03-15 10:00:00", "weather": { "id": 800, "main": "Clear", "description": "sky is clear", "icon": "01d" } } ], "city": { "id": 735563, "name": "Kozani", "country": "GR", "lat": "21.78639", "lon": "40.30111" } }
- Code: 200
-
Error Response:
-
Code: 404 NOT FOUND
Content:{ "status": "forecast not found" }
OR
-
Code: 422 UNPROCESSABLE ENTITY
Content:{ "status": "data are missing" }
-