A simple REST API written in Java, using Jakarta and Tomcat web server. The server has one endpoint, /ping
, which responds with a "pong!" message. Feel free to clone this project and use it as a template for a RESTful API server project.
This setup is inspired by this tutorial.
- IntelliJ (preferred editor)
- JDK
- Tomcat
- A web browser
- Clone the repo, and open the project in IntelliJ
- Open the settings and ensure the "Application Servers" settings includes Tomcat
- Open the Run/Debug Configurations. Ensure Tomcat is the selected application server, and that the port is set to 3000, or any port of your choice. These configurations are stored in a project file in
.idea/runConfigurations
and should work out of the box - Run the application through the run button in the editor
The /ping
endpoint should open automatically in your default browser, if not, visit http://localhost:3000/SimpleRestAPI_war_exploded/api/ping
.