add spring-postgres application sample
Signed-off-by: Anca Iordache <anca.iordache@docker.com>
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package com.company.project;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableAutoConfiguration
|
||||
@ComponentScan(basePackages = {"com.company.project"})
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(Application.class, args);
|
||||
}
|
||||
}
|
@@ -0,0 +1,16 @@
|
||||
package com.company.project.controllers;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@Controller
|
||||
public class HomeController {
|
||||
|
||||
@GetMapping("/")
|
||||
public String showHome(String name, Model model) {
|
||||
return "home";
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1 @@
|
||||
|
9
samples/spring-postgres/backend/src/main/resources/templates/home.ftl
Executable file
9
samples/spring-postgres/backend/src/main/resources/templates/home.ftl
Executable file
@@ -0,0 +1,9 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Getting Started: Serving Web Content</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
</head>
|
||||
<body>
|
||||
<p>Hello from Docker!</p>
|
||||
</body>
|
Reference in New Issue
Block a user