In order to run this example you will need to have Java 17+ and Maven installed.
Before starting, check that your maven version is 3.0.x or above:
mvn -v
-
Clone the repository, and go to the example folder
git clone https://github.com/Moesif/moesif-servlet cd moesif-servlet/examples-jakarta/spring-boot-starter-example-tomcat
-
Update MyConfig to use your own Moesif ApplicationId (Register for an account on moesif.com)
vim src/main/java/com/moesif/servlet/spring/MyConfig.java
-
Compile the example
mvn clean install
-
Run the sample
mvn spring-boot:run
-
Using Postman or CURL, make a few API calls to
http://localhost:8080/api
or the port that Spring Boot is running on. -
Verify the API calls are logged to your Moesif account