SpringDemo - mantoskez/mantas-wiki GitHub Wiki
- We open Intelij.
- Create a new project choosing Spring Boot initializer (double check if we have in there the right release of the JDK)
- Next window, we do not mark anything, just go further.
- There, Spring creates pom.xml file for us. (we need to do some adds to it)
- // Import to be able to write @RequestMapping further down // Requires import via Maven (pom.xml) import org.springframework.web.bind.annotation.RequestMapping; RestController (and @RestController below) to get the content of our methods directly to the browser. // What happens if you delete @RestController below ...? What error message do you get? import org.springframework.web.bind.annotation.RestController;
- When you start the program, you can have to go to the following pages in your browser:
- Open your terminal (Ubuntu, git-bash or Terminal on OSX) and try using the curl program. You may need to run apt install curl in Ubuntu or homebrew install curl on OSX).