Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

🚸 Use rewrites from landing page (#1953)

Luke Vella7a9230b33028
diff --git a/apps/landing/src/middleware.ts b/apps/landing/src/middleware.ts
index cd1148cc3..8a33894fb 100644
--- a/apps/landing/src/middleware.ts
+++ b/apps/landing/src/middleware.ts
@@ -6,5 +6,5 @@ export async function middleware(req: NextRequest) {
}
export const config = {
- matcher: ["/((?!api|_next/static|_next/image|static|.*\\.).*)"],
+ matcher: ["/((?!api|_next/static|_next/image|static|poll|.*\\.).*)"],
};
diff --git a/apps/landing/vercel.json b/apps/landing/vercel.json
index 32563a24b..cad1e248c 100644
--- a/apps/landing/vercel.json
+++ b/apps/landing/vercel.json
@@ -1,5 +1,9 @@
{
+ "$schema": "https://openapi.vercel.sh/vercel.json",
"installCommand": "pnpm install",
"buildCommand": "cd ../.. && pnpm db:generate && pnpm build:landing",
- "outputDirectory": ".next"
+ "outputDirectory": ".next",
+ "rewrites": [
+ { "source": "/poll/:path*", "destination": "https://app.rallly.co/invite/:path*" }
+ ]
}
diff --git a/apps/web/src/app/[locale]/layout.tsx b/apps/web/src/app/[locale]/layout.tsx
index b6b2accea..639a6c4e8 100644
--- a/apps/web/src/app/[locale]/layout.tsx
+++ b/apps/web/src/app/[locale]/layout.tsx
@@ -13,6 +13,7 @@ import type { Params } from "@/app/[locale]/types";
import { requireUser } from "@/auth/data";
import { UserProvider } from "@/components/user-provider";
import { PreferencesProvider } from "@/contexts/preferences";
+import { env } from "@/env";
import type { UserDTO } from "@/features/user/schema";
import { I18nProvider } from "@/i18n/client";
import { FeatureFlagsProvider } from "@/lib/feature-flags/client";
@@ -72,6 +73,9 @@ export default async function Root({
return (
<html lang={locale} className={inter.className}>
+ <head>
+ <base href={env.NEXT_PUBLIC_BASE_URL} />
+ </head>
<body>
<FeatureFlagsProvider value={featureFlagConfig}>
<Toaster />
diff --git a/apps/web/src/env.ts b/apps/web/src/env.ts
index 38471b334..28bd4e945 100644
--- a/apps/web/src/env.ts
+++ b/apps/web/src/env.ts
@@ -92,6 +92,7 @@ export const env = createEnv({
* You'll get type errors if these are not prefixed with NEXT_PUBLIC_.
*/
client: {
+ NEXT_PUBLIC_BASE_URL: z.url(),
NEXT_PUBLIC_POSTHOG_API_KEY: z.string().optional(),
NEXT_PUBLIC_POSTHOG_API_HOST: z.url().optional(),
NEXT_PUBLIC_SELF_HOSTED: z.enum(["true", "false"]).optional(),
@@ -133,6 +134,7 @@ export const env = createEnv({
S3_ACCESS_KEY_ID: process.env.S3_ACCESS_KEY_ID,
S3_SECRET_ACCESS_KEY: process.env.S3_SECRET_ACCESS_KEY,
S3_REGION: process.env.S3_REGION,
+ NEXT_PUBLIC_BASE_URL: process.env.NEXT_PUBLIC_BASE_URL,
NEXT_PUBLIC_POSTHOG_API_KEY: process.env.NEXT_PUBLIC_POSTHOG_API_KEY,
NEXT_PUBLIC_POSTHOG_API_HOST: process.env.NEXT_PUBLIC_POSTHOG_API_HOST,
NEXT_PUBLIC_SELF_HOSTED: process.env.NEXT_PUBLIC_SELF_HOSTED,