Commit 332b11da authored by Andre Blanke's avatar Andre Blanke
Browse files

Return shortened URL with domain instead of localhost

parent 7d20a42b
......@@ -6,6 +6,11 @@ import org.springframework.web.bind.annotation.GetMapping
class IndexController {
* Suppress the SpringMVCViewInspection warning because index.html only exists after Maven's generateResources
* phase and the invocation of ng build using the frontend-maven-plugin.
fun index() = "index.html"
......@@ -26,11 +26,6 @@ class UrlShorteningController @Autowired constructor(private val repository: Url
private fun handleMalformedId(id: String): Nothing =
throw ResponseStatusException(HttpStatus.BAD_REQUEST, "'$id' is not a valid id for linking to a URL.")
fun ping(): String {
return "pong";
* We use a URI instead of a URL here because Java has the ability to open InputStreams from URLs using
* URL.openStream. Because that ability exists, URLStreamHandlers are used for certain protocols and the
......@@ -26,7 +26,7 @@ class UrlMapping(id: Int?, url: String) {
private set
override fun toString(): String =
companion object {
const val ID_RADIX: Int = 36
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment