Update server.py
This commit is contained in:
parent
8cd9f8e4de
commit
9dce43ef96
1 changed files with 6 additions and 3 deletions
|
@ -1,14 +1,17 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
import asyncio, traceback
|
import asyncio, traceback
|
||||||
from flask import Flask, request, render_template
|
from flask import Flask, request, render_template, redirect
|
||||||
from hypercorn.config import Config
|
from hypercorn.config import Config
|
||||||
from hypercorn.asyncio import serve
|
from hypercorn.asyncio import serve
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
@app.route("/")
|
@app.route("/")
|
||||||
def root():
|
def root():
|
||||||
return render_template("home.html")
|
return render_template("home.html")
|
||||||
@app.route("/gem/<url>")
|
@app.route("/gem")
|
||||||
def relay(url):
|
def relay():
|
||||||
|
url = request.args.get('gemini')
|
||||||
|
if url == None:
|
||||||
|
return redirect("/")
|
||||||
parsed = "<h1>Something went wrong...</h1>\n"
|
parsed = "<h1>Something went wrong...</h1>\n"
|
||||||
title = "Something went wrong..."
|
title = "Something went wrong..."
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Reference in a new issue