david/factoriocp
david
/
factoriocp
Archived
1
0
Fork 0
This repository has been archived on 2020-12-06. You can view files and clone it, but cannot push or open issues or pull requests.
factoriocp/app.py

58 lines
1.1 KiB
Python
Raw Normal View History

2016-11-19 09:38:09 +01:00
# 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)