This commit is contained in:
raluca-elena 2014-08-13 11:08:58 -07:00
Родитель 699ece244f
Коммит 64067f5139
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -84,13 +84,15 @@ function readTag(tag, cb) {
//this works only for http requests not for free tags //this works only for http requests not for free tags
function writeTag(tag, data, cb) { function writeTag(tag, data, cb) {
var tagData = allTags[tag]; var tagData = allTags[tag];
console.log("IN WRITE TAG and tagData is ", tagData);
if (tagData === undefined) { if (tagData === undefined) {
cb(undefined, "No such tag: " + tag + " :("); cb(undefined, "No such tag: " + tag + " :(");
} else if (tagData === undefined) { } else if (tagData === undefined) {
cb(undefined, "No url for tag: " + tag + " :("); cb(undefined, "No url for tag: " + tag + " :(");
} else if (isValidURL("http://" +tagData)){ } else if (isValidURL(tagData)){
//superagent.post("http://" + tagData) //superagent.post("http://" + tagData)
var url = "http://" + tagData; console.log("valid tag is:", tagData)
//var url = "http://" + tagData;
superagent.put("http://" + tagData) superagent.put("http://" + tagData)
.send(data) .send(data)
.end(function(res){ .end(function(res){