fix: NEXT_PUBLIC_VERCEL_URL usage

This commit is contained in:
Vyacheslav Matyukhin 2022-04-12 11:37:17 +03:00
parent 473a372515
commit 846e235e0c
No known key found for this signature in database
GPG Key ID: 3D2A774C5489F96C

View File

@ -2,7 +2,7 @@ import { IncomingMessage } from "http";
export const reqToBasePath = (req: IncomingMessage) => { export const reqToBasePath = (req: IncomingMessage) => {
if (process.env.NEXT_PUBLIC_VERCEL_URL) { if (process.env.NEXT_PUBLIC_VERCEL_URL) {
return `https://${process.env.NEXT_PUBLIC_VERCEL_URL}`; return process.env.NEXT_PUBLIC_VERCEL_URL;
} }
// we could just hardcode http://localhost:3000 here, but then `next dev -p <CUSTOM_PORT>` would break // we could just hardcode http://localhost:3000 here, but then `next dev -p <CUSTOM_PORT>` would break