Skip to content

Commit 7076256

Browse files
committed
feat: update axios instance to use environment variable for backend URL and enable credentials
1 parent f0993be commit 7076256

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/api/axios.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import axios from "axios";
22

3-
const url = "https://parlan-blog-backend.vercel.app";
3+
const defaultPath = "http://localhost:3000";
4+
5+
const url = process.env.GATSBY_BACKEND_URL || defaultPath;
46

57
const instance = axios.create({
68
baseURL: url,
9+
withCredentials: true,
710
});
811

912
export default instance;

0 commit comments

Comments
 (0)