mirror of
https://github.com/Galax028/startpage.git
synced 2025-02-10 08:19:13 +01:00
.
This commit is contained in:
parent
4b1811739b
commit
bbe32cb6b7
@ -4,16 +4,16 @@ from flask import Flask, send_from_directory
|
||||
app = Flask(__name__)
|
||||
|
||||
|
||||
@app.get("/")
|
||||
@app.get("/<string:file>")
|
||||
@app.route("/")
|
||||
@app.route("/<string:file>")
|
||||
def startpage(file = None):
|
||||
if not file:
|
||||
return send_from_directory("../", "startpage.html")
|
||||
return send_from_directory("../", "index.html")
|
||||
else:
|
||||
return send_from_directory("../", file)
|
||||
|
||||
|
||||
@app.get("/ac/<string:query>")
|
||||
@app.route("/ac/<string:query>")
|
||||
def deal_with_cors(query):
|
||||
return {"data": requests.get(f"https://ac.duckduckgo.com/ac/?q={query}&type=list").json()[1]}
|
||||
|
||||
|
@ -1,2 +1,2 @@
|
||||
flask==2.0.1
|
||||
requests==2.25.1
|
||||
flask
|
||||
requests
|
Loading…
Reference in New Issue
Block a user