diff options
author | desvox <ofunknowndescent@gmail.com> | 2018-08-04 08:21:01 -0500 |
---|---|---|
committer | desvox <ofunknowndescent@gmail.com> | 2018-08-04 08:21:01 -0500 |
commit | be24ae9dc234e47a632444c7e1c5bbf6c31be09f (patch) | |
tree | 5365f91f6ec5c14874943bab0e7b6952709476f7 /server.py | |
parent | 504ee3fc048c06a9e69c2e32d9fd76c74b060f3d (diff) | |
download | bbj-be24ae9dc234e47a632444c7e1c5bbf6c31be09f.tar.gz |
Allow server to share configuration info with clients.
Diffstat (limited to 'server.py')
-rw-r--r-- | server.py | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -26,7 +26,7 @@ try: app_config.update(json.load(_conf)) except FileNotFoundError: with open("config.json", "w") as _conf: - json.dump(app_config, _conf) + json.dump(app_config, _conf, indent=2) def api_method(function): @@ -186,6 +186,16 @@ class API(object): """ @api_method + def instance_info(self, args, database, user, **kwargs): + """ + Return configuration info for this running instance of the BBJ server. + """ + return { + "allow_anon": app_config["allow_anon"], + "instance_name": app_config["instance_name"] + } + + @api_method def user_register(self, args, database, user, **kwargs): """ Register a new user into the system and return the new user object |