Update environment api route

This commit is contained in:
Moritz Utcke
2024-11-04 17:13:28 +11:00
parent 36ceef2729
commit d9f9f1df34
3 changed files with 11 additions and 4 deletions

View File

@@ -3,10 +3,17 @@ import cookies from 'js-cookie';
import type { AppRouter } from '@ibcornelsen/api';
import { Buffer } from 'buffer';
let url: string = 'http://localhost:3001/';
if (process.env.ENVIRONMENT === "remote") {
url = "http://api.ibcornelsen.de/"
}
export const client = createTRPCProxyClient<AppRouter>({
links: [
httpBatchLink({
url: 'http://localhost:3001/',
url,
headers() {
const accessToken = cookies.get('accessToken');
if (!accessToken) return {};