Rest API Using Spring Boot
This repository contains the code samples for RESTFul Webservice developed using Spring Boot 2.0. This tutorial would be helpful for beginners who wanna start with implementing REST Api using Spring Boot.
You need to install below software(s) before you begin with. If you have them already installed in your Machine, well and good.
To quickly get you the glimpse of RESTFul webservice, I chose Jersey framework to understand the REST controller configuration, HTTP Methods, Path and other stuffs. You will find the example handles the GET and POST request. Make sure you test it with HTTP Client.
{
“id”: 123,
“username”: “Udhay.G”
}
GET: http://localhost:7878/JerseyRestApiExample/rest/welcome/user
GET: http://localhost:7878/JerseyRestApiExample/rest/welcome/user/Udhay
POST: http://localhost:7878/JerseyRestApiExample/rest/welcome/user/save
You are gonna dive into Spring Boot World in this example. A quick simple ‘Hello World’ service (It Greets User) that shows the dependencies and other configuration to make REST application running in Spring Boot environment. Greet yourself by making GET request with your name as Request Param, for your reference endpoints are below.
GET: http://localhost:8080/user/greeting
GET: http://localhost:8080/user/greeting?name=Udhay
Enough introduction. Let’s get into actual work.
You will learn:
https://gist.github.com/smartudhaya/56df064536282c5150773535ad871c28
GET: http://localhost:8080/user
POST: http://localhost:8080/user/save
PUT: http://localhost:8080/update
DELETE: http://localhost:8080/user/delete
You will learn:
https://gist.github.com/smartudhaya/4ec1c20694050314c2d586b74f77a980
Check Swagger UI for all Endpoints - http://localhost:8080/swagger-ui.html (Make sure you imported the application and it is up & running before you access Endpoint).
You will learn:
https://gist.github.com/smartudhaya/7e04ab926e35581e74d8b6fbe660fe9f
GET: http://localhost:8080/product/
POST: http://localhost:8080/product/
You will learn:
http://localhost:9001/i18n/ (Make sure the application is running before your try to access the Endpoint)
Accept-Language: ta (or) Accept-Language: fr (or) Accept-Language: hi
To conclude the REST learning with final demo project: A simple REST Api is created for maintaining Employee inforamtion in the System.
You will learn:
Currently am developing an Angular app that talk to this Api to create, read, update and delete Employee information. Soon will post the repository link here.
Also planning to deploy both Angular and Rest service in AWS so that you can see live demo of it.
Watch the space !
https://gist.github.com/smartudhaya/842879f043019e74130b1da33b016845
Check Swagger UI for all Endpoints - http://localhost:8080/swagger-ui.html (Make sure you imported the application and it is up & running before you access Endpoint).
For Example 1: Run / Deploy on Apache Tomcat Server.
For other examples, embedded tomcat server that comes with Spring boot will be used.
If you wish to deploy the service in AWS, please follow this link - Deploying a Spring Boot Application on AWS Using AWS Elastic Beanstalk.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
This project is licensed under the Apache License - see the LICENSE.md file for details