So I've set up a first time test application Using Spring-Boot, Kotlin, and Intellij.
When I run the project everything seems to start up fine in the console. But when I navigate to http://localhost:8080/
in my browser it gives me a 404 error and a page that looks like this:
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this
as a fallback.
Wed Aug 29 07:54:39 MDT 2018
There was an unexpected error (type=Not Found, status=404).
No message available
Why is it not navigating to the page I created?
Main Class:
package com.daniel.anderson.demo
import ...
@SpringBootApplication
class DemoApplication
fun main(args: Array<String>) {
runApplication<DemoApplication>(*args)
}
The Controller code:
package com.daniel.anderson.demo.controlers
import ...
@Controller
class HtmlController {
@GetMapping("/")
fun blog(model: Model) : String {
model.addAttribute("title","Blog")
return "blog"
}
}
Mustach Files: blog.mustache
{{> header}}
<h1>{{title}}</h1>
<p>hello world</p>
{{> footer}}
footer.mustache
</body>
</html>
header.mustache
<html>
<head>
<title>{{title}}</title>
</head>
<body>
Btw, I get the same error in postman.