diff --git a/back/src/app.js b/back/src/app.js index 92b6cec..72cccf1 100644 --- a/back/src/app.js +++ b/back/src/app.js @@ -14,7 +14,7 @@ app.use(function (req, res, next) { }); // Home Route -app.get('/', async (req, res) => { +app.get('/ua', async (req, res) => { res.json({ message: 'Docker Service :D' }) @@ -73,10 +73,10 @@ const readUserAgents = async (req, res) => { }; // เส้นทางสำหรับ create user agent -app.post("/user-agents", createUserAgent); +app.post("/ua/user-agents", createUserAgent); // เส้นทางสำหรับ read user agents -app.get("/user-agents", readUserAgents); +app.get("/ua/user-agents", readUserAgents); const port = process.env.PORT || 8000 diff --git a/docker-compose.yml b/docker-compose.yml index fe3e2f1..c4df59c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,7 +7,7 @@ services: container_name: useragent restart: always ports: - - 8081:80 + - 8085:80 volumes: # - ./front/default.conf:/etc/nginx/conf.d/default.conf - ./front/html:/usr/share/nginx/html @@ -27,7 +27,7 @@ services: image: useragent_backend container_name: useragent_backend ports: - - 8082:8000 + - 8086:8000 depends_on: - useragent_db diff --git a/front/html/index.html b/front/html/index.html index a7a3c32..25fa8e9 100644 --- a/front/html/index.html +++ b/front/html/index.html @@ -66,7 +66,8 @@ } console.log(data); console.log(window.location); - fetch("http://192.168.1.108:8082/user-agents", { + // fetch("http://192.168.1.108:8086/ua/user-agents", { + fetch("https://ua.klxhub.com/ua/user-agents", { method: "POST", headers: { "Content-Type": "application/json", @@ -76,7 +77,8 @@ .then((response) => response.json()) .then((data) => { console.log(data); - fetch("http://192.168.1.108:8082/user-agents", { + // fetch("http://192.168.1.108:8086/ua/user-agents", { + fetch("https://ua.klxhub.com/ua/user-agents", { method: "GET", headers: { "Content-Type": "application/json",