Update environment api route
This commit is contained in:
@@ -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 {};
|
||||
|
||||
Reference in New Issue
Block a user