RootLandingPageController.java

/*******************************************************************************
 * Copyright (c) 2025 Eclipse RDF4J contributors.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Distribution License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/org/documents/edl-v10.php.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 *******************************************************************************/
// Some portions generated by Codex
package org.eclipse.rdf4j.tools.serverboot;

import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
class RootLandingPageController {

	@GetMapping(path = "/", produces = MediaType.TEXT_HTML_VALUE)
	@ResponseBody
	public String index() {
		return "<!DOCTYPE html>\n"
				+ "<html lang=\"en\">\n"
				+ "<head>\n"
				+ "  <meta charset=\"UTF-8\" />\n"
				+ "  <title>Eclipse RDF4J</title>\n"
				+ "  <style>\n"
				+ "    body { font-family: system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif;\n"
				+ "           margin: 0; padding: 2.5rem; background: #f7f7f9; color: #222; }\n"
				+ "    .page { max-width: 720px; margin: 0 auto; }\n"
				+ "    h1 { margin: 0 0 0.5rem; font-size: 1.8rem; }\n"
				+ "    p.lead { margin: 0 0 1.75rem; color: #555; }\n"
				+ "    ul.links { list-style: none; padding: 0; margin: 0; }\n"
				+ "    ul.links li { margin: 0.4rem 0; }\n"
				+ "    a { color: #005f9e; text-decoration: none; }\n"
				+ "    a:hover { text-decoration: underline; }\n"
				+ "    small { color: #777; }\n"
				+ "  </style>\n"
				+ "</head>\n"
				+ "<body>\n"
				+ "  <main class=\"page\">\n"
				+ "    <h1>Eclipse RDF4J</h1>\n"
				+ "    <p class=\"lead\">Welcome. Choose where you want to start:</p>\n"
				+ "    <ul class=\"links\">\n"
				+ "      <li><a href=\"/rdf4j-workbench/\">Workbench</a> <small>&mdash; browse repositories and manage data</small></li>\n"
				+ "      <li><a href=\"/rdf4j-server/\">Server</a> <small>&mdash; SPARQL endpoint and HTTP APIs</small></li>\n"
				+ "      <li><a href=\"https://rdf4j.org/documentation/\">Documentation</a></li>\n"
				+ "      <li><a href=\"https://rdf4j.org/documentation/tools/server-workbench/\">Workbench guide</a></li>\n"
				+ "      <li><a href=\"https://rdf4j.org/documentation/reference/rest-api/\">REST API reference</a></li>\n"
				+ "    </ul>\n"
				+ "  </main>\n"
				+ "</body>\n"
				+ "</html>\n";
	}
}