Skip to content

Commit

Permalink
localhost to getEnv
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-alt committed Sep 20, 2024
1 parent e61a40c commit 33bdfa7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/components/ChatArea.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ import {io} from 'socket.io-client'
import api from '../config/api';
import { useUser } from '../context/UserContext';
import autoScroll from '../../utility/autoScroll';
import getEnv from '../../utility/getEnv';

const ChatArea = ({ selectedUser }) => {

const {user} = useUser()

const socket = io('http://localhost:5000')
const socket = io(getEnv('VITE_SERVER_URL'))
const [message, setMessage] = useState('')
const [messages, setMessages] = useState([])
const handleSend = () => {
Expand Down
3 changes: 2 additions & 1 deletion src/config/api.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import axios from "axios";
import getEnv from "../../utility/getEnv";

const api = axios.create({
baseURL: "http://localhost:5000",
baseURL: getEnv("VITE_SERVER_URL"),
});

api.interceptors.request.use(
Expand Down

0 comments on commit 33bdfa7

Please sign in to comment.