Skip to content

Commit b9022a6

Browse files
committedAug 1, 2024
add url server
1 parent c030aff commit b9022a6

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed
 

‎src/axios.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@ import axios from 'axios';
22

33
// Функція для визначення, чи є поточний сайт localhost
44
const isLocalhost = () => {
5-
// Перевіряємо, чи виконується код у браузері
6-
if (typeof window !== 'undefined') {
7-
return window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1';
8-
}
9-
// Якщо не в браузері, а в середовищі Node.js, повертаємо false
10-
return false;
5+
// Перевіряємо, чи виконується код у браузері
6+
if (typeof window !== 'undefined') {
7+
return window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1';
8+
}
9+
// Якщо не в браузері, а в середовищі Node.js, повертаємо false
10+
return false;
1111
};
1212

1313
// Змінна для зберігання baseURL
14-
let baseURL = 'https://zelse.asuscomm.com/SchoolHistoryGame';
14+
let baseURL = 'https://aleksdark1313.pythonanywhere.com/';
1515

1616
let remoteServer = false;
1717

1818
// Якщо поточний сайт localhost, змінюємо baseURL
1919
if (isLocalhost() && !remoteServer) {
20-
baseURL = 'http://127.0.0.1:5000/';
20+
baseURL = 'http://127.0.0.1:5000/';
2121
}
2222

2323
const axiosClient = axios.create({
24-
baseURL: baseURL,
24+
baseURL: baseURL,
2525
});
2626

2727
export default axiosClient;

0 commit comments

Comments
 (0)
Please sign in to comment.