Skip to content
This repository was archived by the owner on Dec 1, 2021. It is now read-only.

A very basic example on how to build a RESTful web service with Spring Boot 2.

Notifications You must be signed in to change notification settings

YattaSolutions/spring-boot-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

spring-boot-starter

A very basic example on how to build a RESTful web service with Spring Boot 2.

On startup, Spring will set up an in-memory HSQL database. The database schema will be generated by Hibernate, matching the given JPA entities in the backend.domain package. When the Spring application context has been initialized, the database will be filled with some randomized dummy entries; see the SampleData component for details.

Prerequisites

  • JDK 8 or higher is required
  • Maven 3 or higher is required

Usage

To launch the server, build the project with Maven and simply start the jar file: mvn clean package && java -jar target/backend.jar

Concepts

The application shows examples for the following use cases:

  • configuring a Spring application via annotations and application.properties file
  • serviing static web content with the Spring Boot app (see the static/ folder)
  • creating an in-memory database
  • connecting to a database from a Spring application
  • dependency injection with Spring
  • specification of JPA entities
  • using Spring data repositories inside a Spring application
  • using Spring data repositories as RESTful webservices
  • using Spring Projections as a lightweight alternative to database views
  • using Spring MVC REST controllers which offer more flexibility for when defining a web service API

Notes

  • during database schema generation, the HSQL database might throw an error; the schema generation should succeed nonetheless and the application should still be usable with all sample data

About

A very basic example on how to build a RESTful web service with Spring Boot 2.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published