A Sample Example Code for web-app using Spring-Boot, This guide is meant to give you a quick taste of the integration of Contentstack-Java SDK with Spring Boot web-app. If you want to create your own Spring Boot-based project, visit Spring Initializr, fill in your project details, pick your options, and download a bundled up project as a zip file.
-
A favorite text editor or IDE
-
JDK 1.8 or later
-
Gradle 4+ or Maven 3.2+
-
To start from scratch, move on to Starting with Spring Initializr.
-
To skip the basics, do the following:
-
Download and unzip the source repository for this guide, or clone it using Git:
git clone https://github.com/ishaileshmishra/spring-boot-web-app.git.git
-
cd into contentstack-java-spring-example/initial
-
Jump ahead to Create a Simple Web Application.
-
When you finish, you can check your results against the code in gs-spring-boot/complete.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
To run the application, run the following command in a terminal window (in the complete) directory
./gradlew bootRun
If you use Maven, run the following command in a terminal window (in the complete) directory:
./mvnw spring-boot:run
Now run the service with curl (in a separate terminal window), by running the following command (shown with its output):
$ curl localhost:8080
Or simply click on the below url hosted on herokuapp