-from fastapi import FastAPI, Request, HTTPException
+from fastapi import FastAPI, Request, HTTPException, responses
import sqlite3
from hashlib import sha256
from fastapi.templating import Jinja2Templates
@app.get(base_url+"/")
def index(request: Request, domain: str = None):
+ if domain == "":
+ return responses.RedirectResponse("/")
blocks = get(f"http://127.0.0.1:8069{base_url}/api?domain={domain}")
info = None
if domain == None:
<!DOCTYPE html>
<head>
- <title>fedi-block-api {{domain}}</title>
+ <title>fedi-block-api{% if domain %} {{domain}}{% endif %}</title>
<style>
body {
background-color: #000022;