Skip to content

Latest commit

 

History

History
99 lines (64 loc) · 2.24 KB

README.md

File metadata and controls

99 lines (64 loc) · 2.24 KB

Spring API REST

An API REST build using SpringBoot.

Tech

  • Languages: Java.

  • DataBase: MySQL.

  • Framework: SpringBoot.

  • Libraries: SpringWeb, JPA, MySQL Driver, Lombok.

Installation

  1. Download this repo in your local machine.

  2. Create a MySQL Database with the following command:

    CREATE DATABASE your_db_name;
  3. Move inside this dir:

    cd /path_to_this_repo/src/main/resources
  4. Change this configuration and paste it inside application.properties:

    spring.datasource.url=jdbc:mysql://localhost/your_db_name?useSSL=false&serveTimeZone=UTC
    spring.datasource.username=your_user_name
    spring.datasource.password=your_user_password
    spring.datasource.driver-class=com.mysql.cj.jdbc.Driver
    spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect
    spring.jpa.hibernate.ddl-auto=update
    logging.level.org.hibernate.SQL=debug

Usage

  1. Move inside the root folder of this repo.

  2. Execute the follow command:

    • MacOS/Linux:
    ./mvnw spring-boot:run
    • Windows:
    mvnw spring-boot:run
  3. Use any of the follow CRUD methods with the follow structure in your api tester or code:

    1. GET:

    2. POST:

      {
        "firstName": "first_name_as_string",
        "lastName": "last_name_as_string"
      }
    3. UPDATE:

      {
        "firstName": "new_first_name_as_string",
        "lastName": "new_last_name_as_string"
      }
    4. DELETE:

Author

License