Skip to content

Commit c808ad5

Browse files
author
NaheedRayan
committed
fixed url issue
1 parent 6e410cc commit c808ad5

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ services:
2929
scale : 3
3030
init: true
3131
# cpus: "1"
32-
mem_limit: 250M
32+
mem_limit: 150M
3333

3434
# worker02:
3535
# build: ./worker

server/app.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ app.post('/submit', (req, res) => {
5656
// sending data with the help of emitter
5757
eventEmitter.emit('message_received', data_src);
5858
}
59-
60-
res.status(202).send('http://localhost:8080/results/' + data_src.filename);
59+
60+
res.status(202).send(req.protocol + '://' + req.get('host') + "/results/" + data_src.filename);
61+
// res.status(202).send('http://localhost:8080/results/' + data_src.filename);
6162
} else {
6263

6364
console.log("Invalid Request has been made")
@@ -67,7 +68,12 @@ app.post('/submit', (req, res) => {
6768
}
6869
client.setex(data_src.filename.toString(), 300, JSON.stringify(result));
6970

70-
res.status(202).send('http://localhost:8080/results/' + data_src.filename);
71+
var host = window.location.protocol + "//" + window.location.host;
72+
console.log(host)
73+
74+
// res.status(202).send('http://localhost:8080/results/' + data_src.filename);
75+
res.status(202).send(req.protocol + '://' + req.get('host')+ "/results/" + data_src.filename);
76+
7177
}
7278
})
7379

0 commit comments

Comments
 (0)