mirror of
https://github.com/Galax028/startpage.git
synced 2024-11-21 22:53:08 +01:00
Delete api directory
This commit is contained in:
parent
bbe32cb6b7
commit
d3ab3754da
24
api/index.py
24
api/index.py
@ -1,24 +0,0 @@
|
||||
import requests
|
||||
from flask import Flask, send_from_directory
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
|
||||
@app.route("/")
|
||||
@app.route("/<string:file>")
|
||||
def startpage(file = None):
|
||||
if not file:
|
||||
return send_from_directory("../", "index.html")
|
||||
else:
|
||||
return send_from_directory("../", file)
|
||||
|
||||
|
||||
@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]}
|
||||
|
||||
|
||||
@app.after_request
|
||||
def actually_deal_with_cors(res):
|
||||
res.headers["Access-Control-Allow-Origin"] = "startpage.galax.tech"
|
||||
return res
|
Loading…
Reference in New Issue
Block a user