From 734bd6cdad7453dee72456da0f0953c4f34817d5 Mon Sep 17 00:00:00 2001 From: Annika Backstrom Date: Sat, 2 Jun 2018 15:03:44 +0000 Subject: [PATCH] Allow tag-reader-dummy from non-localhost --- bin/tag-reader-dummy | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/tag-reader-dummy b/bin/tag-reader-dummy index 9eaed9f..345e7d3 100755 --- a/bin/tag-reader-dummy +++ b/bin/tag-reader-dummy @@ -61,7 +61,7 @@ var html = ` console.log(uid); var xhr = new XMLHttpRequest(); - xhr.open('POST', 'http://localhost:8191/', true); + xhr.open('POST', 'http://' + document.location.host + '/', true); xhr.setRequestHeader('Content-Type', 'application\/x-www-form-urlencoded'); xhr.send('uid=' + uid); }; @@ -91,5 +91,7 @@ app.post('/', function(req, res, next) { server.on('request', app); server.listen(8191, function () { - process.stderr.write('tag-reader-dummy listening at http://localhost:8191'); + process.stderr.write('tag-reader-dummy listening at http://*:8191'); }) + +// vim:ft=javascript: