Upload
david-schmitz
View
297
Download
0
Embed Size (px)
Citation preview
Spring Boot(camp)Getting started for the real world
Demo - Main Concepts
Repository
Entity
Controller
Application
The thing that exposes
Resources
The thing that handles Database
access
The Resource
The beginning of everything
Demo - Hello World REST
Repository
Entity
Controller
Database
Demo - Hello World REST
Controller
$ curl http://localhost:8080/helloworld/
Repository
Demo - Hello World REST
Controller
$ curl http://localhost:8080/helloworld/ [{"id":"1","greeting":"Kosice="}, {"id":"2","greeting":"Bonn="}, {"id":"3","greeting":"Duesseldorf="}]
Demo - Hello World REST
Controller
$ curl http://localhost:8080/helloworld/1 {"id":"1","greeting":"Kosice="}
Demo - Hello World RESTcurl -X POST -d 'Kosice'
http://localhost:8080/helloworld/HTTP/1.1 201 Created{"greeting":"Kosice"}
Controller
Building Boot-TodoI want to create a new
Todolist
I want to add a new Todoitem to a Todolist
TodolistPublic Id
Name
TodoitemPublic Id
Description Done?
Due Date
I want to finish a Todoitem
I want to remove Todoitems from a
Todollist
Building Boot-Todo• Fetch Spring-Boot dependencies
• Create Todoitem and Todolist as Resources
• Create RestController and Repository for Todoitem Resource
• Create RestController and Repository for Todolist Resource
• Test it!