I know very little about html programing. I am running a Minecraft server with my friends, and I found a neat program that renders out the entire map in a overview style. This application creates a bunch of files, and then to open the map, you open a file called "index.html". All I want to do, is to open this file with Flask, so that I can send out a link, and if you open said link, Flask will return that "index.html" file.
This is my Flask code:
from flask import Flask, redirect, url_for, render_template,request
app = Flask(__name__)
@app.route("/map")
def home():
return render_template("index.html")
if __name__ == "__main__":
app.run(host= '192.168.2.237', port=9000, debug=False)
and this is index.html:
<!DOCTYPE html>
<html>
<head>
<title>Minecraft Overviewer</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Minecraft-Overviewer 0.16.3 (4c0a69d)" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<script type="text/javascript" src="static/overviewerConfig.js"></script>
<script type="text/javascript" src="static/overviewer.js"></script>
<script type="text/javascript" src="static/baseMarkers.js"></script>
<link rel="stylesheet" href="static/leaflet.css" />
<script src="static/leaflet.js"></script>
<link rel="stylesheet" href="static/overviewer.css" type="text/css" />
</head>
<!-- Generated at: Thu, 20 Aug 2020 01:33:04 FLE Daylight Time -->
<body onload="overviewer.util.initialize()">
<noscript style="color:white; background-color:black">
If you can see this message, there is likely a problem loading the Overviewer JavaScript components.
Check the JavaScript console for error messages.
</noscript>
<div id="mcmap"></div>
</body>
</html>
Ive tried moving stuff to a "static" folder, while keeping only the "index.html" file in the "templates" folder, while changing the "index.html" file slighly. I added the "static/" part to line 11 and others, and that made it load some parts of the webpage. Before, it couldnt load any of the "script type" files that it refers to in index.html, but after doing these changes it now loads them. BUT, now it cant find the image files, and it errors out like this:
compass_upper-left.png:1 GET http://92.35.96.72:9000/compass_upper-left.png 404 (NOT FOUND)
I think the problem is that its not looking in http://92.35.96.72:9000/static/compass_upper-left.png, but I have no idea of how to change that. Is there any way to just make it be able to look in ANY folder?
I really need help with this, and ill gladly try to elaborate or give more info if needed.