Update environment api route
This commit is contained in:
2
Makefile
2
Makefile
@@ -14,4 +14,4 @@ api:
|
||||
|
||||
all:
|
||||
mkdir -p logs
|
||||
bun run dev 2>&1 | tee logs/`date '+%d-%m-%Y_%H:%M:%S'`.log
|
||||
bun run dev 2>&1 | tee ~/logs/`date '+%d-%m-%Y_%H:%M:%S'`.log
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "bun astro dev",
|
||||
"build": "bun --bun astro build",
|
||||
"preview": "bun --bun astro preview",
|
||||
"build": "bun astro build",
|
||||
"preview": "bun astro preview",
|
||||
"astro": "astro",
|
||||
"test:e2e": "cypress run",
|
||||
"test:unit": "bun test",
|
||||
|
||||
@@ -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