Skip to content

Instantly share code, notes, and snippets.

@joshlong
Last active December 21, 2020 21:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save joshlong/d8768b697a73b62bf42d8b74ec43b760 to your computer and use it in GitHub Desktop.
Save joshlong/d8768b697a73b62bf42d8b74ec43b760 to your computer and use it in GitHub Desktop.
///usr/bin/env curl -LSs https://sh.jbang.dev | bash -s - "$0" "$@"; exit $?
//DEPS org.springframework.boot:spring-boot-starter-web:2.3.4.RELEASE
import org.springframework.web.bind.annotation.*;
import org.springframework.boot.*;
import org.springframework.boot.autoconfigure.*;
import org.springframework.context.*;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.context.annotation.*;
import java.util.Collections;
import static java.lang.System.*;
@EnableAutoConfiguration
@Configuration
@RestController
public class GreetingsServer {
@GetMapping("/")
java.util.Map<String, String> index() {
return Collections.singletonMap("greetings", "Hello, world!");
}
public static void main(String... args) {
SpringApplication.run(GreetingsServer.class, args);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment