From f48d7528992899267235e82fb6c6174e2f287ee4 Mon Sep 17 00:00:00 2001 From: Seaswimmer Date: Mon, 5 Aug 2024 15:27:27 -0400 Subject: [PATCH] add actual index page instead of just sending you to a 404 page when hitting the base url --- src/main.py | 8 ++++---- src/templates/index.html | 10 ++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 src/templates/index.html diff --git a/src/main.py b/src/main.py index f50a11c..2118b8c 100644 --- a/src/main.py +++ b/src/main.py @@ -45,10 +45,6 @@ if not config.artifact_names: app = Flask(__name__, template_folder='templates') -@app.route('/') -def index(): - return render_template('404.html') - async def fetch_tasks(): url = f'{config.base_url}/api/v1/repos/{config.user}/{config.repo}/actions/tasks' headers = { @@ -91,6 +87,10 @@ for artifact_name in config.artifact_names: endpoint = f'handle_{artifact_name}' app.add_url_rule(route, view_func=create_handle_artifact(artifact_name), endpoint=endpoint) +@app.route('/') +def index(): + return render_template('index.html', artifact_urls=[f'/{artifact_name}/GalacticFactory' for artifact_name in config.artifact_names]) + def handle_sigterm(*args): print("Received SIGTERM, exiting gracefully...") sys.exit(0) diff --git a/src/templates/index.html b/src/templates/index.html new file mode 100644 index 0000000..cbcd8b0 --- /dev/null +++ b/src/templates/index.html @@ -0,0 +1,10 @@ +{% block body %} +

GalacticFactory Downloader

+

Welcome to the download site for the GalacticFactory modpack!

+

The links below link to the available artifacts:

+ +{% endblock %}