host name fix
This commit is contained in:
parent
6c7af3ed4b
commit
03fb97f357
@ -20,7 +20,8 @@ const GameList = () => {
|
||||
const [upcomingMatches, setUpcomingMatches] = useState([]);
|
||||
|
||||
// API URL
|
||||
const API_URL = 'http://localhost:5500/api';
|
||||
const API_HOST = process.env.REACT_APP_API_HOST || 'localhost:5500';
|
||||
const API_URL = `http://${API_HOST}/api`;
|
||||
|
||||
// Format time
|
||||
const formatTime = (timeString) => {
|
||||
|
||||
@ -15,7 +15,8 @@ const Home = () => {
|
||||
const [currentMonth, setCurrentMonth] = useState(new Date());
|
||||
|
||||
// API URL
|
||||
const API_URL = 'http://localhost:5500/api';
|
||||
const API_HOST = process.env.REACT_APP_API_HOST || 'localhost:5500';
|
||||
const API_URL = `http://${API_HOST}/api`;
|
||||
|
||||
// Fetch teams data
|
||||
useEffect(() => {
|
||||
|
||||
@ -19,7 +19,8 @@ const Home2 = () => {
|
||||
const [upcomingMatches, setUpcomingMatches] = useState([]);
|
||||
|
||||
// API URL
|
||||
const API_URL = 'http://localhost:5500/api';
|
||||
const API_HOST = process.env.REACT_APP_API_HOST || 'localhost:5500';
|
||||
const API_URL = `http://${API_HOST}/api`;
|
||||
|
||||
// Format time
|
||||
const formatTime = (timeString) => {
|
||||
|
||||
@ -15,7 +15,8 @@ const TeamResults = () => {
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
try {
|
||||
const response = await fetch("http://localhost:5500/api/teams");
|
||||
const API_HOST = process.env.REACT_APP_API_HOST || 'localhost:5500';
|
||||
const response = await fetch(`http://${API_HOST}/api/teams`);
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP error! Status: ${response.status}`);
|
||||
|
||||
@ -9,7 +9,8 @@ const MatkaResultsDashboard = () => {
|
||||
const [currentDate, setCurrentDate] = useState('');
|
||||
const [expandedTeams, setExpandedTeams] = useState({});
|
||||
|
||||
const API_URL = 'http://localhost:5500/api';
|
||||
const API_HOST = process.env.REACT_APP_API_HOST || 'localhost:5500';
|
||||
const API_URL = `http://${API_HOST}/api`;
|
||||
|
||||
const matkaTeamInfo = {
|
||||
"Desawar Matka": {
|
||||
|
||||
@ -11,7 +11,8 @@ const TodaysMatch = () => {
|
||||
const [currentDate, setCurrentDate] = useState('');
|
||||
|
||||
// API URL (from environment variable)
|
||||
const API_URL = "http://localhost:5500/api";
|
||||
const API_HOST = process.env.REACT_APP_API_HOST || 'localhost:5500';
|
||||
const API_URL = `http://${API_HOST}/api`;
|
||||
|
||||
// Format time function
|
||||
const formatTime = (timeString) => {
|
||||
|
||||
@ -10,7 +10,8 @@ const MatkaResultsDashboard = () => {
|
||||
const [expandedTeams, setExpandedTeams] = useState({});
|
||||
|
||||
// API URL
|
||||
const API_URL = 'http://localhost:5500/api';
|
||||
const API_HOST = process.env.REACT_APP_API_HOST || 'localhost:5500';
|
||||
const API_URL = `http://${API_HOST}/api`;
|
||||
|
||||
// Matka team descriptions and tips
|
||||
const matkaTeamInfo = {
|
||||
|
||||
@ -2,8 +2,9 @@
|
||||
import axios from 'axios';
|
||||
import { io } from 'socket.io-client';
|
||||
|
||||
const API_URL = 'http://localhost:3000/api';
|
||||
const socket = io('http://localhost:3000');
|
||||
const API_HOST = process.env.REACT_APP_API_HOST || 'localhost:3000';
|
||||
const API_URL = `http://${API_HOST}/api`;
|
||||
const socket = io(`http://${API_HOST}`);
|
||||
|
||||
export const DataService = {
|
||||
// Get all teams
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user