Skip to content

ahmedolaibrahim/ztp-springboot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Spring Boot REST API

A Restful CRUD API for a simple Book Management Application using Spring Boot, MongoDB, JPA, Junit and MockMVC

Table of Contents

Requirements

  • Java 1.8.x
  • MongoDB
  • Maven 3.x.x

Setup

Steps to Setup

1. Clone the application

git clone https://github.com/ahmedolaibrahim/ztp-springboot.git

2. Create MongoDB database

 use ztp_bootspring

3. Change mongoDb access credentials to suit your mongo deployment

  • open src/main/resources/application.properties

  • change spring.data.mongodb.host,spring.data.mongodb.port, spring.data.mongodb.username, spring.data.mongodb.password and ``spring.data.mongodb.database` as per your mongodb deployment

4. Build and run the app using maven

mvn package
java -jar target/ztp-books-1.0.0.jar

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

mvn spring-boot:run

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

Tests

Running Tests**

mvn test

if tests runs successfully you should have Image 1

Routes

The app defines following routes.

  • GET /api/books Image 2

  • POST /api/books Image 2

  • GET /api/books/{bookId}

  • PUT /api/books/{bookId}

  • DELETE /api/books/{bookId}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages