diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6a315c5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +*.conf +bottle.py +__pycache__ +__pycache__/* +*.pyc diff --git a/app.py b/app.py new file mode 100644 index 0000000..7aca830 --- /dev/null +++ b/app.py @@ -0,0 +1,57 @@ +# imports + +import requests +from configparser import ConfigParser +from bottle import route, run, template, error, get, \ + post, request, response, redirect, \ + static_file + + +# config + +configfile = "app.conf" +config = ConfigParser() +config.read(configfile) + +if config['DEFAULT']['app_name']: + app_name = config['DEFAULT']['app_name'] +else: + app_name = "FactorioCP" + +if config['DEFAULT']['static_files']: + static_files = config['DEFAULT']['static_files'] +else: + static_files = "static" + +if config['DEFAULT']['cookie_secret']: + cookie_secret = config['DEFAULT']['cookie_secret'] +else: + cookie_secret = "norealsecretDTR47SNI2390LGFsn4T-LASED2309h" + +if config['DEFAULT']['cookie_max_age']: + cookie_max_age = int(config['DEFAULT']['cookie_max_age']) +else: + cookie_max_age=3600 + +if config['DEFAULT']['cookie_name']: + cookie_name = config['DEFAULT']['cookie_name'] +else: + cookie_name = "factoriocp" + + +# functions + + +# routing + +@get('/') +def home(): + pass + + + +# run development webserver +run(host='localhost', port=8000, debug=True, reloader=True) + +# run prod server +#run(host='0.0.0.0', port=8000)