Created
April 16, 2019 21:44
-
-
Save marcgeld/37f29bdba8c08a56d40a24bf379998e4 to your computer and use it in GitHub Desktop.
A very simple Spring Boot Application in groovy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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