Java / Spring Boot Hello World
Create a Spring Boot application with a REST controller.
src/main/java/com/example/demo/HelloController.java:
package com.example.demo;
import org.springframework.web.bind.annotation.GetMapping;import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
@RestControllerpublic class HelloController {
@GetMapping("/") public Map<String, String> hello() { return Map.of("message", "Hello World"); }}src/main/java/com/example/demo/DemoApplication.java:
package com.example.demo;
import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplicationpublic class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); }}Run it locally:
./mvnw spring-boot:runcurl http://localhost:8080# {"message":"Hello World"}Ready to deploy? Use the Origin Clouds CLI or SDK to push your app.
Deploy to Origin Clouds →