Skip to content

ruslan-marian/message-store

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Message Store

This exercise is a RESTful API to work as a basic message store.

Quick start

  1. Use Git to clone this repo.
  2. To build the project: ./mvnw clean install.
  3. To serve it: ./mvnw spring-boot:run.
  4. To test: http://localhost:8080.
  5. To shutdown: send POST to http://localhost:8080/actuator/shutdown

Project description

The project is built with Spring Boot using these Starters and dependencies:

  1. Web - Full-stack web development with Tomcat.
  2. JPA - Java Persistence API including spring-data-jpa, spring-orm and Hibernate
  3. H2 - H2 database (with embedded support)
  4. HATEOAS - HATEOAS-based RESTful services
  5. DevTools - Spring Boot Development Tools

The embedded database is initialized automatically at startup. This is enabled by placing the data.sql file in the src/main/resources folder.

Endpoints

  1. POST: /actuator/shutdown Shuts down the server.
    http://localhost:8080/actuator/shutdown

  2. GET: client/{client_id} Retrieves a client by its id.
    http://localhost:8080/client/1

  3. GET: message/messageid:{message_id} Retrieves a message by its id.
    http://localhost:8080/message/messageid:1

  4. GET: message/messageid:{message_id}/clientid:{client_id} Retrieves a message of a client.
    http://localhost:8080/message/messageid:1/clientid:1

  5. GET: message/clientid:{client_id} Retrieves all available messages of a client.
    http://localhost:8080/message/clientid:1

  6. POST: message/clientid:{client_id} Creates a new message for given client.

  7. PUT message/messageid:{message_id}/clientid:{client_id} Creates a message for given client.

References

Spring Initializr
Building REST Services with Spring
Shutdown a Spring Boot Application

About

A basic message store

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages