diff --git a/index.py b/index.py index facee1a..2e8f098 100644 --- a/index.py +++ b/index.py @@ -1,5 +1,6 @@ import cherrypy import json +import pathlib import requests import youtube_dlc from extractors.video import extract_video @@ -129,10 +130,14 @@ class NewLeaf(object): bind_port = getattr(configuration, "bind_port", 3000) bind_host = getattr(configuration, "bind_host", "0.0.0.0") +server_root = pathlib.Path(__file__).parent.joinpath("root") cherrypy.config.update({"server.socket_port": bind_port, "server.socket_host": bind_host}) cherrypy.quickstart(NewLeaf(), "/", { "/": { - "tools.custom_headers.on": True + "tools.custom_headers.on": True, + "tools.staticdir.on": True, + "tools.staticdir.dir": str(server_root.absolute()), + "tools.staticdir.index": "index.html" } }) diff --git a/root/robots.txt b/root/robots.txt new file mode 100644 index 0000000..c6742d8 --- /dev/null +++ b/root/robots.txt @@ -0,0 +1,2 @@ +User-Agent: * +Disallow: /