Can two frontend services point to the same base url?
for example we have a landing page: foobar.com which runs on service A. Once a user signs in, they are redirected to foobar.com/home running on service b. And any further links from foobar.com/* are directed to service b while the baseurl foobar.com always goes to service A.
22 Replies
but. why?
one service just runs the landing page aka foobar.com. Another service handles the authenticated experience aka foobar.com/home
im just trying to determine if i should merge my landing page repo into my main frontend repo haha
yeah this is very possible
just depends where your running it and such
if it's behind an nginx instance this is quite trivial
regardless, most people (including me) would suggest merging the repo's, or having your 2nd project live on a subdomain and not a route level proxy on one domain
this latter is how a lot of modern SaaS company's do it
yeah was looking at the subdomain path. landing page on foobar.com and authenticated service on app.foobar.com
pscale, clerk, posthog, retool, etc
yepp that's super common
If this is an option, do it
that way your landing page can be controlled by your marketing team and the actual app can be your core eng team
so marketing doesn't need to have 1000 slack calls with you to update the landing page
yeah thats why i was hoping to avoid merging the two. our marketing team knows how to update the text fine on our repo via prs. but i really dont want to spam our eng team with text updates
exactly
yeah do the subdomain route
it's much more common
you doing even have to authenticate on the tld
well cool. ill go and see how vercel supports it
just make your sign in button a redirect to the subdomain, and redirect /sign-in on the subdomain if the user is already logged in to their home page
it is
we basically do this with https://biblish.com
but instead of 1 subdomain we have a bunch
all hosted on Vercel
whats the setup look like to point service b to the subdomain?
but like 5 different projects
service b is just another app on vercel
right ive got my two apps up
is it just the domain setting?
a subdomain is it's own domain, it just lives under the other one on the DNS level kinda
yeah literally just domain settings
ahh i see
im guessing ill have to actually setup the subdomain on my name providers site
sounds like its hosted under a different ip then
go to your DNS provider or whatnot and put in the records Vercel gives you, one for landing and one for app
right
I think you can do fancy shit with vercel but I don't think it's worth it
if your on Vercel, technically, everything is on some random ass domain more less
but yeah
awesome ok thanks guys. this was super helpful