minimaws: easier mod_wsgi deployment (nw)

This commit is contained in:
Vas Crabb 2019-09-30 20:00:23 +10:00
parent cf1f9cc6bb
commit 9fbded3fa1
2 changed files with 11 additions and 3 deletions

View file

@ -589,6 +589,8 @@ class MiniMawsApp(object):
def __call__(self, environ, start_response):
application_uri = wsgiref.util.application_uri(environ)
if application_uri[-1] != '/':
application_uri += '/'
module = wsgiref.util.shift_path_info(environ)
if module == 'machine':
return MachineHandler(self, application_uri, environ, start_response)

View file

@ -78,13 +78,17 @@
## and see dependent slots update. Required command-line arguments to
## produce the selected configuration are also displayed.
import argparse
import os
import os.path
import sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import lib.auxverbs
import lib.lxparse
import lib.wsgiserve
import argparse
import sys
if __name__ == '__main__':
parser = argparse.ArgumentParser()
@ -135,3 +139,5 @@ if __name__ == '__main__':
lib.wsgiserve.run_server(options)
elif options.command == 'load':
lib.lxparse.load_info(options)
else:
application = lib.wsgiserve.MiniMawsApp(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'minimaws.sqlite3'))