LoginSignup
6
4

More than 5 years have passed since last update.

とりあえずSpringbootをあっさり動かすメモ

Last updated at Posted at 2016-06-08

HomebrewでSpringCLIをインストール

brew tap pivotal/tap
brew install springboot

SpringCLIの動作確認

spring --version

groovyスクリプト(hello.groovy)を作成する。

@RestController
class WebApplication {

    @RequestMapping("/")
    String home() {
        "Hello World!"
    }
}

groovyスクリプト(hello.groovy)を実行する。

spring run hello.groovy

localhostにアクセスして「Hello World!」の出力を確認する。デフォルトポートは8080

ポート指定(9000)でgroovyスクリプトを実行する場合

spring run hello.groovy -- --server.port=9000

JVMオプションを指定してgroovyスクリプトを実行する場合

JAVA_OPTS=-Xmx1024m spring run hello.groovy

参考URL

6
4
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
6
4