Skip to content

Instantly share code, notes, and snippets.

@marcgeld
Created April 16, 2019 21:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcgeld/37f29bdba8c08a56d40a24bf379998e4 to your computer and use it in GitHub Desktop.
Save marcgeld/37f29bdba8c08a56d40a24bf379998e4 to your computer and use it in GitHub Desktop.
A very simple Spring Boot Application in groovy
#!/usr/bin/env groovy
package myapp
@Grab('org.springframework:spring-context:5.1.6.RELEASE')
@Grab('org.springframework:spring-web:5.1.6.RELEASE')
@Grab('org.springframework.boot:spring-boot:2.1.4.RELEASE')
@Grab('org.springframework.boot:spring-boot-starter:2.1.4.RELEASE')
@Grab('org.springframework.boot:spring-boot-starter-webflux:2.1.4.RELEASE')
@Grab('org.springframework.boot:spring-boot-starter-actuator:2.1.4.RELEASE')
import org.springframework.stereotype.Component
import org.springframework.boot.SpringApplication
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestParam
import org.springframework.web.bind.annotation.RestController
// Web-page at http://localhost:8080
@SpringBootApplication
@RestController
public class App {
@RequestMapping("/")
public String home() {
return "Hello Spring Boot! " + new Date()
}
public static void main(String[] args) throws Exception{
SpringApplication.run(App.class, args)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment