Added a testing endpoint for now.

This commit is contained in:
Andrew Lalis 2019-03-02 12:48:16 +01:00 committed by andrewlalis
parent 4b3e304610
commit 7d6f10e3fc
3 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,17 @@
package nl.andrewlalis.teaching_assistant_assistant.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 TestController {
@GetMapping("/test")
public String test (@RequestParam(name="name", required=false, defaultValue="World") String name, Model model) {
model.addAttribute("name", name);
return "test";
}
}

View File

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Teaching Assistant Assistant</title>
</head>
<body>
<h1>Hello world!</h1>
<p>
This is a testing homepage while the website is being built.
</p>
</body>
</html>

View File

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<title>Test Controller Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<p th:text="'Hello, ' + ${name} + '!'"></p>
</body>
</html>