From 652a3b56d779ee393555971114b7347fad593d52 Mon Sep 17 00:00:00 2001 From: Filip Rojek Date: Wed, 8 May 2024 21:30:30 +0200 Subject: [PATCH] Added .env file --- frontend/.env.example | 1 + frontend/.gitignore | 2 ++ frontend/app/context/AuthContext.js | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 frontend/.env.example diff --git a/frontend/.env.example b/frontend/.env.example new file mode 100644 index 0000000..a173b50 --- /dev/null +++ b/frontend/.env.example @@ -0,0 +1 @@ +EXPO_PUBLIC_API_URL=http://10.69.1.137:6060/api/v1 \ No newline at end of file diff --git a/frontend/.gitignore b/frontend/.gitignore index 05647d5..8591fe5 100644 --- a/frontend/.gitignore +++ b/frontend/.gitignore @@ -33,3 +33,5 @@ yarn-error.* # typescript *.tsbuildinfo + +.env \ No newline at end of file diff --git a/frontend/app/context/AuthContext.js b/frontend/app/context/AuthContext.js index 1a08b36..79dcd4a 100644 --- a/frontend/app/context/AuthContext.js +++ b/frontend/app/context/AuthContext.js @@ -2,7 +2,7 @@ import { createContext, useContext, useEffect, useState } from "react"; import storageUtil from "./storage"; const TOKEN_KEY = "my-jwt"; -export const API_URL = "http://10.69.1.137:6060/api/v1"; +export const API_URL = process.env.EXPO_PUBLIC_API_URL; const AuthContext = createContext(null); export function useAuth() {