diff options
author | Daniel Friesel <derf@finalrewind.org> | 2021-03-27 12:53:38 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2021-03-27 12:53:38 +0100 |
commit | 2bd30e325041ad7ec5afe7044e559070616621e9 (patch) | |
tree | 68ed19eb5f1c74e8585fe7795bffe34dae648c2d | |
parent | 5b1230ccfe644e132fba7c5548336ccbb91ef04b (diff) |
add prefix argument for reverse-proxy setups
-rwxr-xr-x | bin/efa-gw | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -72,9 +72,10 @@ if __name__ == "__main__": "--eva-csv", type=str, metavar="FILE", default="haltestellenMitEva.csv" ) parser.add_argument("--port", type=int, metavar="PORT", default=8080) + parser.add_argument("--prefix", type=str, metavar="PATH", default="/") args = parser.parse_args() eva_to_name = load_eva_to_name(args.eva_csv) app = web.Application() - app.add_routes([web.get("/{eva}.json", handle_eva)]) + app.add_routes([web.get(f"{args.prefix}{{eva}}.json", handle_eva)]) web.run_app(app, host="localhost", port=args.port) |