LoginSignup
1
5

More than 5 years have passed since last update.

Spring Bootのjsonを返すサンプルを1分で動かす

Last updated at Posted at 2017-04-08

シンプルなjsonを返すSpring BootのサンプルBuilding a RESTful Web Serviceを動かすまでのメモ

ただ動かすだけなら

  1. リポジトリをcloneする

  2. gs-rest-service/completeまで移動する

  3. ./gradlew bootRun

  4. ブラウザでhttp://localhost:8080/greetingにアクセスする

  5. 実行結果

{
id: 1,
content: "Hello, World!"
}

intelliJで動かすなら

環境: IntelliJ IDEA 2016.3.6

  1. intelliJを起動してimport Projectを選ぶ
    スクリーンショット 2017-04-08 19.59.25.png
  2. gs-rest-service/complete配下のbuild.gradleを選択、初期設定のままでOK
  3. shiftを2連続タップで Search Everywhere を起動、Graまで入力してGradle Tool Windowを開く スクリーンショット 2017-04-08 20.00.54.png
  4. taskからbootRunを選択
    スクリーンショット 2017-04-08 19.57.59.png

  5. ブラウザでhttp://localhost:8080/greetingにアクセスする

  6. 実行結果

{
id: 1,
content: "Hello, World!"
}
1
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
5