trpc: fix query with basePath
This commit is contained in:
parent
f85373689a
commit
2d496f8f6a
@ -5,10 +5,10 @@ import type { AppRouter } from './routers';
|
||||
|
||||
function getBaseUrl() {
|
||||
if (typeof window !== 'undefined') {
|
||||
return '';
|
||||
return process.env.NEXT_PUBLIC_BASE_PATH ?? '';
|
||||
}
|
||||
|
||||
return `http://localhost:${process.env.PORT ?? 3000}`;
|
||||
return `http://localhost:${process.env.PORT ?? 3000}${process.env.NEXT_PUBLIC_BASE_PATH ?? ''}`;
|
||||
}
|
||||
|
||||
export const trpcClient = createTRPCNext<AppRouter>({
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user