added env file for api url
This commit is contained in:
1
.env.example
Normal file
1
.env.example
Normal file
@@ -0,0 +1 @@
|
||||
REACT_APP_API_URL="localhost:5000"
|
||||
@@ -3,7 +3,7 @@ import {GHButton} from "../components/Button";
|
||||
import {Link} from "react-router-dom";
|
||||
import useTitle from "../../utils/TitleHook";
|
||||
|
||||
const ROOM_URL = 'http://localhost:5062/room';
|
||||
const ROOM_URL = `http://${process.env.REACT_APP_API_URL}/room`;
|
||||
|
||||
const Home = () => {
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ const Room = () => {
|
||||
|
||||
const {roomId} = useParams();
|
||||
|
||||
const WS_URL = `ws://localhost:5062/room/${roomId}`;
|
||||
const WS_URL = `ws://${process.env.REACT_APP_API_URL}/room/${roomId}`;
|
||||
|
||||
const [message, setMessage] = React.useState<string>('');
|
||||
const [messages, setMessages] = React.useState<string[]>([]);
|
||||
|
||||
Reference in New Issue
Block a user