diff --git a/bin/tag-reader-dummy b/bin/tag-reader-dummy
index 2ab3d27..6acd3c7 100755
--- a/bin/tag-reader-dummy
+++ b/bin/tag-reader-dummy
@@ -1,5 +1,71 @@
-#!/bin/bash
+const express = require('express');
+const bodyParser = require('body-parser');
-while echo 1234567890 ; do
- sleep 0.2
-done
+const mustache = require('express');
+
+var html = `
+
+
+
+
+
+
+
+
+
+
tag-reader-dummy
+
+
+
+
+
+
+
+
+`;
+
+var app = express();
+var server = require('http').createServer();
+
+app.use(bodyParser.urlencoded({ extended: true }));
+
+app.get('/', function(req, res, next) {
+ res.send(html);
+});
+
+app.post('/', function(req, res, next) {
+ var uid = req.body.uid;
+ if (uid) {
+ process.stdout.write(uid);
+ }
+ res.send('ok');
+});
+
+server.on('request', app);
+
+server.listen(8191, function () {
+ process.stderr.write('tag-reader-dummy listening at http://localhost:8191');
+})
diff --git a/nodemon.json b/nodemon.json
index 0013b86..5bb2a40 100644
--- a/nodemon.json
+++ b/nodemon.json
@@ -4,5 +4,6 @@
"player.js"
, "jukebox"
, "templates"
+ , "bin/tag-reader-dummy"
]
}
diff --git a/package.json b/package.json
index ff5dd96..0eec539 100644
--- a/package.json
+++ b/package.json
@@ -14,6 +14,7 @@
"author": "",
"license": "ISC",
"dependencies": {
+ "body-parser": "^1.17.1",
"express": "^4.14.0",
"glob": "^7.1.1",
"morgan": "^1.7.0",
diff --git a/player.js b/player.js
index 0592fa9..b26365a 100644
--- a/player.js
+++ b/player.js
@@ -54,6 +54,7 @@ process.on('exit', exitHandler.bind(null));
process.on('SIGINT', exitHandler.bind(null, {exit:true}));
TagReader.on('message', tag => {
+ logger.debug("got tag from tagreader", { tag: tag });
MediaLibrary.find(tag);
});