package edu.nudt.demo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.beans.factory.annotation.Value;

@SpringBootApplication
@Controller
public class DemoApplication {
	@Value("${demo.server.name}")
	private String serverName;

	@GetMapping("/")
	public String index(final Model model) {
		model.addAttribute("title", "Backend Server: " + serverName);
		model.addAttribute("msg", "欢迎来到分布式计算的世界!");
		return "index";
	}

	public static void main(String[] args) {
		SpringApplication.run(DemoApplication.class, args);
	}

}
