diff options
author | xengineering <mail2xengineering@protonmail.com> | 2021-03-06 20:51:23 +0100 |
---|---|---|
committer | xengineering <mail2xengineering@protonmail.com> | 2021-03-06 20:51:23 +0100 |
commit | f48ce5deb19d83e6d5e87f51c59e538f4b66d79e (patch) | |
tree | d95ac46c757c4506044fbb4e0469ecadf3f78ef7 /src | |
parent | f9714353664507845bad9e5856f5396ab3d629b2 (diff) | |
download | web-template-f48ce5deb19d83e6d5e87f51c59e538f4b66d79e.tar web-template-f48ce5deb19d83e6d5e87f51c59e538f4b66d79e.tar.zst web-template-f48ce5deb19d83e6d5e87f51c59e538f4b66d79e.zip |
Switch back to Flask
Diffstat (limited to 'src')
-rw-r--r-- | src/config.ini | 5 | ||||
-rw-r--r-- | src/server.py | 21 | ||||
l--------- | src/static/index.html | 1 |
3 files changed, 27 insertions, 0 deletions
diff --git a/src/config.ini b/src/config.ini new file mode 100644 index 0000000..2a67194 --- /dev/null +++ b/src/config.ini @@ -0,0 +1,5 @@ + +[web-template] +project_name=my_web_server +friendly_project_name=My first web Server + diff --git a/src/server.py b/src/server.py new file mode 100644 index 0000000..2caddd6 --- /dev/null +++ b/src/server.py @@ -0,0 +1,21 @@ +#!/usr/bin/python3 +# vim: shiftwidth=4 tabstop=4 expandtab + + +import waitress +from flask import Flask + + +app = Flask(__name__) + + +@app.route("/", methods=["GET"]) +def index(): + return app.send_static_file("index.html") + + +if __name__ == '__main__': + waitress.serve(app, listen="127.0.0.1:8080") # production server / bind to port + #serve(app, unix_socket='/run/web-template/unix.sock') # production server / unix domain socket + #app.run() # debug server - NOT FOR PRODUCTION! + diff --git a/src/static/index.html b/src/static/index.html new file mode 120000 index 0000000..44d1dd6 --- /dev/null +++ b/src/static/index.html @@ -0,0 +1 @@ +../../lib/html/example.html
\ No newline at end of file |