fix(api): update API base URL to use env vars and target api.canina.ir / stageapi.canina.ir
Some checks failed
Deploy Canina / deploy (push) Has been cancelled
Some checks failed
Deploy Canina / deploy (push) Has been cancelled
This commit is contained in:
parent
fecc3cfb65
commit
027f169830
@ -2,7 +2,7 @@ import axios from 'axios';
|
||||
|
||||
export const BASE_DOMAIN = import.meta.env.VITE_API_URL
|
||||
? import.meta.env.VITE_API_URL.replace(/\/api$/, '')
|
||||
: (import.meta.env.DEV ? 'http://127.0.0.1:4001' : 'https://apicanina.parsaaghayi.ir');
|
||||
: (import.meta.env.DEV ? 'http://127.0.0.1:4001' : 'https://api.canina.ir');
|
||||
|
||||
const baseURL = `${BASE_DOMAIN}/api`;
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import axios from 'axios';
|
||||
|
||||
const baseURL = typeof window !== 'undefined' ? '/api' : (process.env.NEXT_PUBLIC_API_URL || (process.env.NODE_ENV === 'development' ? 'http://localhost:4001/api' : 'https://apicanina.parsaaghayi.ir/api'));
|
||||
const baseURL = process.env.NEXT_PUBLIC_API_URL || (process.env.NODE_ENV === 'development' ? 'http://localhost:4001/api' : 'https://api.canina.ir/api');
|
||||
|
||||
const api = axios.create({
|
||||
baseURL,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user