diff options
author | Sascha Roloff <sascha.roloff@huawei.com> | 2025-05-12 12:59:11 +0200 |
---|---|---|
committer | Sascha Roloff <sascha.roloff@huawei.com> | 2025-05-12 16:52:10 +0200 |
commit | 215b348553ed1b286a143b21e0c1582c71e8230c (patch) | |
tree | dd85bb0df84b6ddd2cddaf7b4b1b6627b7b18a56 /doc/invocations-http-server/server.py | |
parent | 5b3c6136e3e896019acb1bbc117615255c5f924a (diff) | |
download | justbuild-215b348553ed1b286a143b21e0c1582c71e8230c.tar.gz |
Invocation server: add css style file
Diffstat (limited to 'doc/invocations-http-server/server.py')
-rwxr-xr-x | doc/invocations-http-server/server.py | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/doc/invocations-http-server/server.py b/doc/invocations-http-server/server.py index 7121ec75..bb9d2260 100755 --- a/doc/invocations-http-server/server.py +++ b/doc/invocations-http-server/server.py @@ -22,6 +22,7 @@ import werkzeug.routing import werkzeug.utils from werkzeug.wrappers import Request, Response +from werkzeug.middleware.shared_data import SharedDataMiddleware def core_config(conf): new_conf = {} @@ -442,6 +443,13 @@ class InvocationServer: return self.render("invocation.html", params) +def create_app(logsdir, **kwargs): + app = InvocationServer(logsdir, **kwargs) + app = SharedDataMiddleware(app, { + '/static': os.path.join(os.path.dirname(__file__), 'static') + }) + return app + if __name__ == '__main__': import sys from argparse import ArgumentParser @@ -472,10 +480,10 @@ if __name__ == '__main__': print("just-mr argument should be valid json, but %r is not: %s" % (args.just_mr, e), file=sys.stderr) sys.exit(1) - app = InvocationServer(args.DIR, - just_mr=just_mr, - graph=args.graph, - artifacts=args.artifacts, - meta=args.meta, - profile=args.profile) + app = create_app(args.DIR, + just_mr=just_mr, + graph=args.graph, + artifacts=args.artifacts, + meta=args.meta, + profile=args.profile) make_server(args.interface, args.port, app).serve_forever() |