Giter Site home page Giter Site logo

umbrellapp's Introduction

Umbreallpp

Εγκατάσταση

Στο αρχείο umbrellapp files υπάρχει το αρχείο umbrellapp.sql. Δημιουργεί την βάση με τις κατάλληλες εγγραφές. Το default username και password για την βάση είναι root και '', τα οποία μπορούν να αλλάξουν από το config/database.

Documentation

Search City By Name

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" 
           } 
        ]
      
  • Error Response:

    • Code: 404 NOT FOUND
      Content:

        { "status": "city not found" }

      OR

    • Code: 422 UNPROCESSABLE ENTITY
      Content:

        { "status": "name is missing" }

Search City By Coordinates

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" 
           }
        ]
      
  • Error Response:

    • Code: 404 NOT FOUND
      Content:

        { "status": "city not found" }

      OR

    • Code: 422 UNPROCESSABLE ENTITY
      Content:

        { "status": "data are missing" }

Save Favourite City

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"
        }
  • Error Response:

    • Code: 409 CONFLICT
      Content:

       { "status": "city is already in favourite list" }

      OR

    • Code: 422 UNPROCESSABLE ENTITY
      Content:

        { "id": ["id is missing"] }

Show Favourite Cities

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"
          }
        ]
      
  • Error Response:

    • Code: 500 INTERNAL SERVER ERROR
      Content:
       { "status": "an error occurred while retrieving favourite cities" }

Delete Favourite City

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" }
  • Error Response:

    • Code: 404 NOT FOUND
      Content:

       { "status": "city not found" }

      OR

    • Code: 422 UNPROCESSABLE ENTITY
      Content:

        { "status": "id is missing" }

Get City Forecast

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" 
             }
        }
      
  • Error Response:

    • Code: 404 NOT FOUND
      Content:

       { "status": "forecast not found" }

      OR

    • Code: 422 UNPROCESSABLE ENTITY
      Content:

        { "status": "data are missing" }

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.