mirror of
https://github.com/senju1337/senju.git
synced 2025-12-24 07:39:29 +00:00
Merge pull request #23 from senju1337/feat/OPS-36
feat/OPS-36: add favicon
This commit is contained in:
commit
d3bbcff2d1
2 changed files with 11 additions and 1 deletions
|
|
@ -2,11 +2,14 @@ from __future__ import annotations
|
|||
|
||||
from pathlib import Path
|
||||
|
||||
from flask import Flask, redirect, render_template, request, url_for
|
||||
from flask import (Flask, redirect, render_template, request, url_for,
|
||||
send_from_directory)
|
||||
|
||||
from senju.haiku import Haiku
|
||||
from senju.store_manager import StoreManager
|
||||
|
||||
import os
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
store = StoreManager(Path("/tmp/store.db"))
|
||||
|
|
@ -60,3 +63,10 @@ def generate_haiku():
|
|||
return str(id)
|
||||
else:
|
||||
return "Method not allowed", 405
|
||||
|
||||
|
||||
@app.route('/favicon.ico')
|
||||
def favicon():
|
||||
return send_from_directory(os.path.join(app.root_path, 'static/img'),
|
||||
'favicon.ico',
|
||||
mimetype='image/vnd.microsoft.icon')
|
||||
|
|
|
|||
BIN
senju/static/img/favicon.ico
Normal file
BIN
senju/static/img/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
Loading…
Add table
Add a link
Reference in a new issue