31 lines
632 B
Python
31 lines
632 B
Python
from system_module import db, gelbooru, logger
|
|
from flask import Flask, render_template
|
|
import json
|
|
|
|
CONFIG_ROOT = json.load(open("config.json", "r", encoding="utf-8"))
|
|
CONFIG_PORT = CONFIG_ROOT["port"]
|
|
|
|
app = Flask(__name__)
|
|
|
|
@app.route("/")
|
|
def index():
|
|
return render_template("index.html")
|
|
|
|
|
|
@app.route("/analytics")
|
|
def analytics():
|
|
return render_template("analytics.html")
|
|
|
|
|
|
@app.route("/post/<path:post_id>")
|
|
def post(post_id):
|
|
return render_template("post.html")
|
|
|
|
|
|
@app.route("/api", methods=["GET", "POST"])
|
|
def api():
|
|
return "", 204
|
|
|
|
|
|
if __name__ == "__main__":
|
|
app.run(host="0.0.0.0", port=CONFIG_PORT) |