aboutsummaryrefslogtreecommitdiff
path: root/hydrilla-wsgi.py
diff options
context:
space:
mode:
Diffstat (limited to 'hydrilla-wsgi.py')
-rw-r--r--hydrilla-wsgi.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/hydrilla-wsgi.py b/hydrilla-wsgi.py
new file mode 100644
index 0000000..45ec248
--- /dev/null
+++ b/hydrilla-wsgi.py
@@ -0,0 +1,26 @@
+# SPDX-License-Identifier: CC0-1.0
+
+# Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org>
+#
+# Available under the terms of Creative Commons Zero v1.0 Universal.
+
+import sys
+
+_application = None
+
+def application(environ, *args):
+ global _application
+
+ if _application is None:
+ sys.path.extend(environ['HYDRILLA_GUIX_PYTHONPATH'].split(':'))
+
+ from hydrilla.server import start_wsgi, config
+
+ current_config = {
+ **config.load(),
+ 'malcontent_dir': environ['MALCONENT_DIR']
+ }
+
+ _application = start_wsgi(standalone_mode=False, obj=current_config)
+
+ return _application(environ, *args)