Giter VIP home page Giter VIP logo

restful-api-springboot's Introduction

Restful API

RESTful API for CRUD operations, developed with Spring Boot in Java.

Function

Six RESTful APIs for the Game Store web application.

API Description URL
GET /api/products Get all products GET http://localhost:8080/api/products
GET /api/products/{id} Get a product by ID GET http://localhost:8080/api/products/1
POST /api/products Add a new product POST http://localhost:8080/api/products
PUT /api/products/{id} Update a product PUT http://localhost:8080/api/products/1
DELETE /api/products/{id} Delete a product DELETE http://localhost:8080/api/products/1
POST /api/upload Upload an image POST http://localhost:8080/api/upload

Setup Locally

git clone https://github.com/jojozhuang/restful-api-springboot.git
mvn spring-boot:run

Access http://localhost:8080/api/products in web browser or PostMan, you should get the following JSON as response.

[  
   {  
      "id":3,
      "productName":"Wireless Controller",
      "price":19.99,
      "image":"http://localhost:5000/images/controller.jpg"
   },
   {  
      "id":2,
      "productName":"Wii",
      "price":269.0,
      "image":"http://localhost:5000/images/wii.jpg"
   },
   {  
      "id":1,
      "productName":"Xbox 360",
      "price":299.0,
      "image":"http://localhost:5000/images/xbox360.jpg"
   }
]

Deploy to Heroku

Follow tutorial Deploying Spring Boot RESTful API to Heroku to deploy this Spring Boot app to Heroku.

Follow tutorial Continuously Deploy Spring Boot App to Heroku with Travis-CI to continuously deploy this Spring Boot app to Heroku with Travis-CI.

The available RESTful API on Heroku is

For example, request https://gamestore-api.herokuapp.com/api/products to get all products.

Portfolio

Read portfolio Game Store(Angular) or Game Store(React) to learn how these RESTful APIs are consumed by Angular and React applications.

Tutorial

Read tutorial Building RESTful API with Spring Boot to learn how this RESTful API is built.

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.