Adds Oxigraph logo as ther server HTML UI flavicon

pull/51/head
Tpt 4 years ago
parent 5a5308f619
commit 39fdf4b16b
  1. 7
      server/src/main.rs
  2. 1
      server/templates/query.html

@ -33,6 +33,7 @@ use url::form_urlencoded;
const MAX_SPARQL_BODY_SIZE: u64 = 1_048_576;
const HTML_ROOT_PAGE: &str = include_str!("../templates/query.html");
const LOGO: &str = include_str!("../../logo.svg");
const SERVER: &str = concat!("Oxigraph/", env!("CARGO_PKG_VERSION"));
#[derive(FromArgs)]
@ -67,6 +68,12 @@ async fn handle_request(request: Request, store: RocksDbStore) -> Result<Respons
response.set_body(HTML_ROOT_PAGE);
response
}
("/logo.svg", Method::Get) => {
let mut response = Response::new(StatusCode::Ok);
response.append_header(headers::CONTENT_TYPE, "image/svg+xml");
response.set_body(LOGO);
response
}
("/", Method::Post) => {
if let Some(content_type) = request.content_type() {
match if let Some(format) = GraphFormat::from_media_type(content_type.essence()) {

@ -5,6 +5,7 @@
<title>Oxigraph server</title>
<link href="https://unpkg.com/@triply/yasgui@4/build/yasgui.min.css" rel="stylesheet" type="text/css" />
<script src="https://unpkg.com/@triply/yasgui@4/build/yasgui.min.js"></script>
<link rel="icon" type="image/svg+xml" href="/logo.svg">
</head>
<body>
<div id="yasgui"></div>

Loading…
Cancel
Save