Giter Club home page Giter Club logo

samplebook's Introduction

Basic Springboot template v0.1

Base template that can be used a starter project. Hooked up the following together.

  1. SpringBoot – Web
  2. SpringBoot – Security (Security not enabled; all access provided)
  3. SpringBoot – Thymeleaf (No special handling done)
  4. SpringBoot – MongoDB (Not configured params)

Other Implementation:

  1. Book Object
  2. Book Repository stores on MongoDB
  3. Book Rest Controller to implement CRUD

Prerequests: Ensure the MongoDB is installed and local instance is running before running the app.

How to run this application:

Run this app as SpringBoot

http://localhost:8080/ Hello null! Signout button

http://localhost:8080/hello Hello null! Signout button

http://localhost:8080/book Result should be blank

Use a Browser plugin like RESTClient for Firefox to initiate POST requests: URL: http://localhost:8080/book Header:

Name Content-Type Value application/json;charset=UTF-8 Body: { "name":"Jungle book", "isbn":"12345", "author":"sudhakar", "pages":200 }

Should see response as below: {"message":"Book created successfully","book":{"id":"5760c149a7c8b745392a781e","name":"Jungle book","isbn":"12345","author":"sudhakar","pages":200}}

List all books from database with this Get request:

http://localhost:8080/book {"totalBooks":1,"books":[{"id":"5760c149a7c8b745392a781e","name":"Jungle book","isbn":"12345","author":"sudhakar","pages":200}]}

Verify the Database changes:

use test switched to db test show collections book webURL db.book.find() { "_id" : ObjectId("5760c149a7c8b745392a781e"), "_class" : "com.sample2.feeder.model.Book", "name" : "Jungle book", "isbn" : "12345", "author" : "sudhakar", "pages" : 200 }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.