Skip to content

Commit

Permalink
Use custom domain for LP hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
mlejva committed Dec 6, 2024
1 parent 9dd6d3f commit d502d34
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion apps/web/src/app/hostnames.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// We are in the process of migrating to the new landing page hosting.
export const landingPageWebflowHostname = 'e2b-dev.webflow.io'
export const landingPageHostname = 'e2b-landing-page.com'
export const landingPageFramerHostname = 'e2b-landing-page.framer.website'
export const blogFramerHostname = 'e2b-blog.framer.website'
export const changelogFramerHostname = 'e2b-changelog.framer.website'
10 changes: 5 additions & 5 deletions apps/web/src/middleware.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NextRequest, NextResponse } from 'next/server'
import { replaceUrls } from '@/utils/replaceUrls'
import {
landingPageWebflowHostname,
landingPageHostname,
landingPageFramerHostname,
blogFramerHostname,
changelogFramerHostname,
Expand All @@ -17,22 +17,22 @@ export async function middleware(req: NextRequest): Promise<NextResponse> {

if (url.pathname === '' || url.pathname === '/') {
if (process.env.NODE_ENV === 'production') {
url.hostname = landingPageWebflowHostname
url.hostname = landingPageHostname
} else {
return NextResponse.redirect(new URL('/dashboard', req.url))
}
}

if (url.pathname.startsWith('/terms')) {
url.hostname = landingPageWebflowHostname
url.hostname = landingPageHostname
}

if (url.pathname.startsWith('/privacy')) {
url.hostname = landingPageWebflowHostname
url.hostname = landingPageHostname
}

if (url.pathname.startsWith('/pricing')) {
url.hostname = landingPageWebflowHostname
url.hostname = landingPageHostname
}

// TODO: Not on the new landing page hosting yet
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/utils/replaceUrls.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {
landingPageWebflowHostname,
landingPageHostname,
landingPageFramerHostname,
blogFramerHostname,
changelogFramerHostname,
Expand All @@ -13,7 +13,7 @@ export function replaceUrls(text: string, urlPathName: string, prefix: string =
(_, url) => url + suffix,
)
.replaceAll(
`${prefix}${landingPageWebflowHostname}`,
`${prefix}${landingPageHostname}`,
`${prefix}https://e2b.dev`
)
.replaceAll(
Expand Down

0 comments on commit d502d34

Please sign in to comment.