diff --git a/src/command/impl/addSubPathCommand.py b/src/command/impl/addSubPathCommand.py index 81f65d2..963d3b2 100644 --- a/src/command/impl/addSubPathCommand.py +++ b/src/command/impl/addSubPathCommand.py @@ -39,4 +39,4 @@ class AddSubPathCommand(Command): traefikConfig.addSubPathRouter(subPathName, domain, path, serviceHost) traefikConfig.save() - print(f"Access your service at http://{domain}") \ No newline at end of file + print(f"Access your service at http://{domain}{path}") \ No newline at end of file diff --git a/src/traefik/traefikConfig.py b/src/traefik/traefikConfig.py index 0628b1f..bea1a82 100644 --- a/src/traefik/traefikConfig.py +++ b/src/traefik/traefikConfig.py @@ -75,6 +75,9 @@ class TraefikConfig: return name in self.configYml["http"]["middlewares"] def addPathRewrite(self, name, path): + if not path.endswith("/"): # Add trailing slash + path += "/" + self.configYml["http"]["middlewares"][name] = { "stripPrefix": { "prefixes": [path]