Skip to content

Sample REST CRUD API with Java, Docker, Spring Boot, Mysql, JPA and Hibernate

License

Notifications You must be signed in to change notification settings

naldomadeira/rest-api-spring

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spring-api-rest

Sample REST CRUD API with Java, Docker, Spring Boot, Mysql, JPA and Hibernate

Java Docker !Spring !Mysql

Components

  • Java OpenJDK 15
  • Insomnia
  • Container Docker MySQL
  • MySQL Workbench

Dependecies

  • Spring Boot
  • JPA / Hibernate
  • MySQL Driver

Usage

  1. Clone the application
$ https://github.com/naldomadeira/rest-api-spring.git
$ cd rest-api-spring
  1. Create Mysql database

create database spring_database

  1. Change mysql username and password as per your installation

open src/main/resources/application.properties

change spring.datasource.username and spring.datasource.password as per your mysql container or installation standard

  1. Build and run the app using maven

mvn package java -jar target/rest-api-spring-0.0.1-SNAPSHOT.jar

Alternatively, you can run the app without packaging it using -

mvn spring-boot:run

The app will start running at http://localhost:8080.

RESTful API Server

The following is a generic localhost configuration on port: 3000 Note: base_url: http://localhost:8080/api/v1

List of all users - GET: base_url/users

Create a user - POST: base_url/users

List a user - GET: base_url/users/{id}

Update a user - PUT: base_url/users/{id}

Delete a user - Delete: base_url/users/{id}

Tests

They were entirely carried out in the automated environment of insomnia. Insomnia is an extremely useful tool for testing manually or automating the testing of any REST API.

insomnia-api-rest

Credits

This API was developed by Francinaldo Madeira

Linkedin Badge

Releases

No releases published

Packages

No packages published

Languages