Code Monkey home page Code Monkey logo

spring-weather-api's Introduction

Environment:

  • Java version: 1.8
  • Maven version: 3.*
  • Spring Boot version: 2.2.1.RELEASE

Data:

Example of a weather data JSON object:

{
   "id": 1,
   "date": "1985-01-01",
   "lat": 36.1189,
   "lon": -86.6892,
   "city": "Nashville",
   "state": "Tennessee",
   "temperature": 17.3
}

POST request to /weather :

  • creates a new weather data record
  • expects a valid weather data object as its body payload, except that it does not have an id property; you can assume that the given object is always valid
  • adds the given object to the database and assigns a unique integer id to it
  • the response code is 201 and the response body is the created record, including its unique id

GET request to /weather:

  • the response code is 200
  • the response body is an array of matching records, ordered by their ids in increasing order

GET request to /weather/<id>:

  • returns a record with the given id
  • if the matching record exists, the response code is 200 and the response body is the matching object
  • if there is no record in the database with the given id, the response code is 404

DELETE request to /weather/<id>:

  • deletes the record with the given id from the database
  • if a matching record existed, the response code is 204
  • if there was no record in the database with the given id, the response code is 404

Commands

  • run:
mvn clean package; java -jar target/WeatherApi-1.0-SNAPSHOT.jar
  • install:
mvn clean install
  • test:
mvn clean test

spring-weather-api's People

Contributors

monsieurnganga avatar

Watchers

 avatar

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.