I have a simple flask setup on repl.it running with the code below.
#The flask server to keep bot alive
from flask import Flask
from threading import Thread
app = Flask('')
#Define served page HTML
@app.route('/')
def home():
return """
<body style="background-color:black;">
<h1 style='color: red;'>TreesBot is Running on Port:8080</h1>
<embed src="song.mp3" loop="true" autostart="true" width="2"
height="0">
</div>
"""
#Make repl.it run the server on port 8080
def run():
app.run(host='0.0.0.0',port=8080)
#Run it on a different thread from the main program
def keep_alive():
t = Thread(target=run)
t.start()
As you can see the HTML sets the page background, and an embedded .mp3 file for background music. However when i try to load the .mp3 file with flask it gives me the following error in the console:
172.18.0.1 - - [29/Dec/2020 12:47:44] "GET /song.mp3 HTTP/1.1" 404 -
This 404 makes me think its not finding the file. Can anyone see what Im doing wrong?
The full code repository is available here: https://repl.it/@MixtapeMessiah/Esoterica-v10#keep_alive.py
Thanks for any help you can provide.