mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
Merge pull request #287 from lorenzomigliorero/fix/remove-path-prefix
feat: keep path prefix only if different than /
This commit is contained in:
@@ -88,6 +88,17 @@ test("Web entrypoint on http domain", async () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
expect(router.middlewares).not.toContain("redirect-to-https");
|
expect(router.middlewares).not.toContain("redirect-to-https");
|
||||||
|
expect(router.rule).not.toContain("PathPrefix");
|
||||||
|
});
|
||||||
|
|
||||||
|
test("Web entrypoint on http domain with custom path", async () => {
|
||||||
|
const router = await createRouterConfig(
|
||||||
|
baseApp,
|
||||||
|
{ ...baseDomain, path: "/foo", https: false },
|
||||||
|
"web",
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(router.rule).toContain("PathPrefix(`/foo`)");
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Web entrypoint on http domain with redirect", async () => {
|
test("Web entrypoint on http domain with redirect", async () => {
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ export const createRouterConfig = async (
|
|||||||
|
|
||||||
const { host, path, https, uniqueConfigKey } = domain;
|
const { host, path, https, uniqueConfigKey } = domain;
|
||||||
const routerConfig: HttpRouter = {
|
const routerConfig: HttpRouter = {
|
||||||
rule: `Host(\`${host}\`)${path ? ` && PathPrefix(\`${path}\`)` : ""}`,
|
rule: `Host(\`${host}\`)${path !== null && path !== "/" ? ` && PathPrefix(\`${path}\`)` : ""}`,
|
||||||
service: `${appName}-service-${uniqueConfigKey}`,
|
service: `${appName}-service-${uniqueConfigKey}`,
|
||||||
middlewares: [],
|
middlewares: [],
|
||||||
entryPoints: [entryPoint],
|
entryPoints: [entryPoint],
|
||||||
|
|||||||
Reference in New Issue
Block a user