A tiny Springboot app
This miniblog is adpated from this linkedin course
The tweet that started it all
Install springboot cli
Easiest way is via sdkman.
sdk install springboot
Groovy classFile:
ThisClassWillActuallyRun.groovy
@Controller
class ThisWillActuallyRun {
@RequestMapping("/")
@ResponseBody
String home() {
"Hello World!"
}
}
Running the app:
spring ThisWillActuallyRun
Output:
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.1.3.RELEASE)
2019-03-15 00:26:53.437 INFO 1091 --- [ runner-0] o.s.boot.SpringApplication : Starting application on sysadm-Latitude-5480 with PID 1091 (started by sudipbhandari in /home/sudipbhandari)
2019-03-15 00:26:53.452 INFO 1091 --- [ runner-0] o.s.boot.SpringApplication : No active profile set, falling back to default profiles: default
Verifying Output:
curl localhost:8080
Hello World!%