diff --git a/cli/src/commands/put-stream.js b/cli/src/commands/put-stream.js index c13e48fffc2c99d98df403043c70356c632ec851..db7b6c582840c5cf427c20d6f413d6d5320b93d8 100644 --- a/cli/src/commands/put-stream.js +++ b/cli/src/commands/put-stream.js @@ -12,7 +12,7 @@ const fetch = require("node-fetch"); const handleErrors = require("../utils/handleErrors"); const getMaster = require("../utils/getMaster"); -module.exports.command = "put-stream"; +module.exports.command = "put-stream [name]"; module.exports.describe = "Writes localfilename to the SDFS as sdfsfilename."; module.exports.builder = (yargs: any) => yargs; @@ -62,7 +62,7 @@ module.exports.handler = handleErrors(async (argv: {}) => { setInterval(function sync() { if (queue.length > 0) { const body = queue.pop(); - var target = "http://"+ master + ":3000/spout/"; + var target = "http://"+ master + ":3000/spout/" + argv.name; console.log(target) console.log(JSON.stringify(body)) fetch(target, { diff --git a/sfds/index.js b/sfds/index.js index 2ecf297cd60c24667badef075c2cc9a56667048f..32807fdac9a5fab3dfa45256632f0cadad2b0af4 100644 --- a/sfds/index.js +++ b/sfds/index.js @@ -406,8 +406,8 @@ app.post("/bolt", function(req, res) { res.send(resolver(req.body)); }); -app.post("/spout", function(req, res) { - // console.log(req.body); +app.post("/spout/:name", function(req, res) { + console.log(req.params.name); queue.push(req.body) // console.log(queue.length) res.send("got it");