Skip to content

Commit a5175b1

Browse files
committed
Add favicon (close #32)
1 parent cf63fbf commit a5175b1

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

app.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from flask import Flask, jsonify, request, render_template, send_from_directory
1+
from flask import Flask, jsonify, request, render_template, send_from_directory, send_file
22
from waitress import serve
33
from lib import CollectionRegistry, TerminologyRegistry, MappingRegistry, ApiError, NotFound, ValidationError, TripleStore
44
import argparse
@@ -74,6 +74,8 @@ def status():
7474
return values
7575

7676

77+
route('GET', '/icon.png', lambda: send_file("static/nfdi4objects-logo.png"))
78+
7779
api('GET', '/status.json', status)
7880

7981
api('GET', '/terminology/', lambda: terminologies.list())

templates/head.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
<meta charset="utf-8">
55
<title>{{ title }}</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<link rel="icon" href="{{ root }}icon.png" sizes="32x32" />
8+
<link rel="icon" href="{{ root }}icon.png" sizes="192x192" />
9+
<link rel="apple-touch-icon" href="{{ root }}icon.png" />
710
<style type="text/css">
811
body {
912
margin: 20px;

tests/test_api.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,8 @@ def test_api(client):
210210
assert resp.status_code == 200
211211
assert b"N4O Graph Import API TEST" in resp.data
212212

213+
assert client.get('/icon.png').status_code == 200
214+
213215
assert client.get('/data/').status_code == 200
214216
assert client.get('/data/data.ttl').status_code == 200
215217

0 commit comments

Comments
 (0)