Skip to content

Commit

Permalink
fix: import server uri from the .env
Browse files Browse the repository at this point in the history
  • Loading branch information
Hk669 committed Jul 10, 2024
1 parent 2411f06 commit 0feb114
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion client/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function App() {
const token = localStorage.getItem("jwt_token");
if (token) {
try {
const response = await fetch("http://127.0.0.1:8000/verify-token", {
const response = await fetch(`${process.env.REACT_APP_API_URL}/verify-token`, {
method: "GET",
headers: {
Authorization: `Bearer ${token}`,
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Input/Input.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const Input = ({ onSubmit }) => {

try {
const response = await axios.post(
"http://127.0.0.1:8000/api/recommendations/",
`${process.env.REACT_APP_API_URL}/api/recommendations/`,
{
languages: languages,
extra_topics: extraTopics,
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Login/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { FaGithub } from "react-icons/fa";

const Login = () => {
const handleLogin = () => {
window.location.href = "http://127.0.0.1:8000/github-login";
window.location.href = `${process.env.REACT_APP_API_URL}/github-login`;
};

return (
Expand Down
2 changes: 1 addition & 1 deletion client/src/utils/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const refreshToken = async () => {
const currentToken = localStorage.getItem("jwt_token");
try {
const response = await axios.post(
"http://127.0.0.1:8000/refresh-token",
`${process.env.REACT_APP_API_URL}/refresh-token`,
{},
{
headers: {
Expand Down

0 comments on commit 0feb114

Please sign in to comment.