diff --git a/app.py b/app.py index a4a410a..1882d49 100644 --- a/app.py +++ b/app.py @@ -4,11 +4,25 @@ A simple Flask application for interacting with WHSPAH shockers. import argparse import logging +import os import waitress.server import flask -app = flask.Flask(__name__) +app = flask.Flask(__name__, static_folder='./www/') + +@app.route('/', defaults={'path': 'index.html'}) +@app.route('/') +def staticPage(path): + """ + Returns anything requested in the static folder. + """ + + if os.path.isfile(os.path.join(app.static_folder, path, 'index.html')): + path = os.path.join(path, 'index.html') + + return flask.send_from_directory(app.static_folder, path) + if __name__ == '__main__': parser = argparse.ArgumentParser() diff --git a/www/index.html b/www/index.html new file mode 100644 index 0000000..2f3b91f --- /dev/null +++ b/www/index.html @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/www/main.js b/www/main.js new file mode 100644 index 0000000..e69a55f --- /dev/null +++ b/www/main.js @@ -0,0 +1 @@ +console.debug('Main loaded!'); diff --git a/www/styles.css b/www/styles.css new file mode 100644 index 0000000..4530134 --- /dev/null +++ b/www/styles.css @@ -0,0 +1,5 @@ +body { + /* Anything but light mode, please. */ + background-color: #000000; + color: #FFFFFF; +} \ No newline at end of file