Spring Boot Template Application - This is a spring boot template application which performs CRUD operations on company details.
- Spring Boot Framework
- Tomcat (embedded)
- Java 8
- Maven Build Framework
- Java Persistence API and Apache Derby (for persistency)
Name | Description | Default |
---|---|---|
server.contextPath | The base URL to be allocated on deployment | /companies |
server.port | The port on which the application needs to be deployed | 8080 |
GET
List all the companies and their details:http://<host>:<port>/<base-path>
GET
Details of a specific company:http://<host>:<port>/<base-path>/{companyId}
POST
Create new company details:http://<host>:<port>/<base-path>
- Request Body:
{ "name": <string - name of the company>, "description": <string - description of the company>, "logo": <string - base64 encoded image>, "fundingDetails": [ { "amount": <long - funding amount>, "date": <date - funding date>, "stage": <string - stage>, "investor": <string - investor> } ], "markets": [ <string - markets>, ... ], "foundedOn": <date - founded on>, "website": <string - link to website>, "socialInformation": { "email": <email>, "phoneNumber": <phone>, "linkedIn": <linkedIn profile>, "twitter": <twitter handle>, ... <additional-key-value-pairs> } }
- Request Body:
PUT
Update existing company details:http://<host>:<port>/<base-path>/{companyId}
- Request Body:
{ "id": <string - companyId as in the url>, "name": <string - name of the company>, "description": <string - description of the company>, "logo": <string - base64 encoded image>, "fundingDetails": [ { "id": <int - funding id (if any)>, "amount": <long - funding amount>, "date": <date - funding date>, "stage": <string - stage>, "investor": <string - investor> } ], "markets": [ <string - markets>, ... ], "foundedOn": <date - founded on>, "website": <string - link to website>, "socialInformation": { "email": <email>, "phoneNumber": <phone>, "linkedIn": <linkedIn profile>, "twitter": <twitter handle>, ... <additional-key-value-pairs> } }
- Request Body:
DELETE
Delete existing company details:http://<host>:<port>/<base-path>/{companyId}
- Clone the repository:
git clone https://github.com/agrawal93/spring-template-app.git && cd spring-template-app
- Build the project:
mvn clean install
- Run the project:
java -jar target/spring-template-app-1.0.0.jar
- Access the REST APIs at
http://localhost:8080