Skip to content

Commit a9b372b

Browse files
Update App.java
1 parent 243765c commit a9b372b

1 file changed

Lines changed: 36 additions & 8 deletions

File tree

src/main/java/com/example/App.java

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,50 @@
22

33
import org.springframework.boot.SpringApplication;
44
import org.springframework.boot.autoconfigure.SpringBootApplication;
5-
import org.springframework.stereotype.Controller;
6-
import org.springframework.ui.Model;
75
import org.springframework.web.bind.annotation.GetMapping;
6+
import org.springframework.web.bind.annotation.RestController;
87

98
@SpringBootApplication
10-
@Controller
119
public class App {
12-
1310
public static void main(String[] args) {
1411
SpringApplication.run(App.class, args);
1512
}
13+
}
14+
15+
@RestController
16+
class HelloController {
1617

1718
@GetMapping("/")
18-
public String home(Model model) {
19-
// Pass the header text to the view
20-
model.addAttribute("header", "Cloud Computing in Telugu");
21-
return "index"; // Return the index.html template
19+
public String hello() {
20+
return """
21+
<!DOCTYPE html>
22+
<html>
23+
<head>
24+
<title>Spring Boot on Amazon Linux</title>
25+
<style>
26+
body {
27+
background: linear-gradient(to right, #4facfe, #00f2fe);
28+
color: white;
29+
font-family: Arial, sans-serif;
30+
display: flex;
31+
justify-content: center;
32+
align-items: center;
33+
height: 100vh;
34+
margin: 0;
35+
}
36+
h1 {
37+
background: rgba(0, 0, 0, 0.3);
38+
padding: 20px 40px;
39+
border-radius: 15px;
40+
box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.2);
41+
text-align: center;
42+
}
43+
</style>
44+
</head>
45+
<body>
46+
<h1>Hello from <br>Spring Boot on Amazon Linux!</h1>
47+
</body>
48+
</html>
49+
""";
2250
}
2351
}

0 commit comments

Comments
 (0)