groovyスクリプトをポート8080で上手く接続できない、エラーが出る場合の対処方法です。
ポート9000で実行する場合の例
コマンドプロンプト(ターミナル)で以下のように入力します。
spring run test.groovy -- --server.port=9000
問題なく実行できたら以下のURLで実行結果を確認しましょう。
参考:実行ソース例
ファイル名:test.groovy
hello.php
@RestController
class App{
@RequestMapping("/")
def home(){
"Hello!"
}
}
参考:JVMオプションを指定して実行する
JAVA_OPTS=-Xmx1024m spring run test.groovy
参考:https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#cli-run