diff --git a/server/main.go b/server/main.go
index 1c7785f..44e459b 100644
--- a/server/main.go
+++ b/server/main.go
@@ -34,5 +34,5 @@ func main() {
movie.Use(jwtMiddleware())
movie.GET("/", MovieList)
- eg.Run(":4444")
+ eg.Run("0.0.0.0:4444")
}
diff --git a/src/Main.jsx b/src/Main.jsx
index fd1a5e1..59280df 100644
--- a/src/Main.jsx
+++ b/src/Main.jsx
@@ -52,7 +52,7 @@ const Main = () => {
setLoading(true);
try {
const response = await axios.get(
- `${config.Host}/movie/?page=${page}&limit=${limit}&category=${category}`
+ `${window.location.origin}/movie/?page=${page}&limit=${limit}&category=${category}`
);
if (response.status === 200) {
@@ -74,7 +74,7 @@ const Main = () => {
} finally {
setLoading(false);
}
- }, [config.Host, limit]);
+ }, [window.location.origin, limit]);
useEffect(() => {
const currentCategory = params.lastCategory;
diff --git a/src/components/LoginForm.jsx b/src/components/LoginForm.jsx
index 180f559..350d6b1 100644
--- a/src/components/LoginForm.jsx
+++ b/src/components/LoginForm.jsx
@@ -23,7 +23,7 @@ function LoginForm() {
e.preventDefault();
try {
- const response = await axios.post(`${config.Host}/api/login`, new URLSearchParams({
+ const response = await axios.post(`${window.location.origin}/api/login`, new URLSearchParams({
username,
password,
}), {
diff --git a/src/components/MovieCard.jsx b/src/components/MovieCard.jsx
index fd34d47..9659948 100644
--- a/src/components/MovieCard.jsx
+++ b/src/components/MovieCard.jsx
@@ -38,7 +38,7 @@ const MovieCard = ({ movie, config }) => {
{truncateFilename(movie.filename, 15)}
diff --git a/src/components/VideoPlayer.jsx b/src/components/VideoPlayer.jsx
index d54f5e1..25360e5 100644
--- a/src/components/VideoPlayer.jsx
+++ b/src/components/VideoPlayer.jsx
@@ -30,7 +30,7 @@ const VideoPlayer = () => {
{filename}