summaryrefslogtreecommitdiffstats
path: root/ogcp/og_server.py
diff options
context:
space:
mode:
authorRoberto Hueso Gómez <rhueso@soleta.eu>2020-08-31 11:55:19 +0200
committerRoberto Hueso Gómez <rhueso@soleta.eu>2020-08-31 11:58:27 +0200
commitdf2e425b346b95c6493a684025374b956349a0da (patch)
tree7dcceec2a1c7dc863ea98c733abd638a46e6656a /ogcp/og_server.py
parent0e160da4c03ebb197793f8ebd3ebf543b22bc566 (diff)
Add basic backend structure
This adds views functions and ogServer config loading.
Diffstat (limited to 'ogcp/og_server.py')
-rw-r--r--ogcp/og_server.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/ogcp/og_server.py b/ogcp/og_server.py
new file mode 100644
index 0000000..6242f02
--- /dev/null
+++ b/ogcp/og_server.py
@@ -0,0 +1,15 @@
+import json
+
+class OGServer:
+ def __init__(self, ip='127.0.0.1', port=8888, api_token=""):
+ self.ip = ip
+ self.port = port
+ self.api_token = api_token
+
+ def load_config(self, path):
+ with open(path, 'r') as f:
+ cfg = json.load(f)
+
+ self.ip = cfg['ip']
+ self.port = cfg['port']
+ self.api_token = cfg['api_token']