working slave
This commit is contained in:
Родитель
1577ede456
Коммит
00e89f9db4
|
@ -1,5 +1,4 @@
|
|||
var baseurl = "http://localhost:8080";
|
||||
console.log("FUCK");
|
||||
var baseurl = "http://10.0.0.6:8080";
|
||||
$.ajax({"url":baseurl + "/ls"}).done(function (data) {
|
||||
|
||||
console.log("MUAUHAHAHA", data);
|
||||
|
@ -7,7 +6,6 @@ $.ajax({"url":baseurl + "/ls"}).done(function (data) {
|
|||
ls.forEach(function (thingid) {
|
||||
var url = baseurl + "/thing/" + thingid;
|
||||
console.log("thingid is ", thingid, "url is ", url);
|
||||
// alert(url);
|
||||
$.ajax({"url":url}).done(function (data) {
|
||||
var entry = JSON.parse(data);
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"directoryServer": "http://oldvps.glek.net:8080",
|
||||
"directoryServer": "http://oldvsp.glek.net:8080",
|
||||
"tagFile":"/tmp/tags.json",
|
||||
"port":3000,
|
||||
"features":{
|
||||
|
|
|
@ -37,6 +37,7 @@ try {
|
|||
}
|
||||
|
||||
app.get("/tags/", function(req, res) {
|
||||
console.log('i am in get tags');
|
||||
res.json(state);
|
||||
})
|
||||
|
||||
|
@ -46,6 +47,7 @@ function commit(callback) {
|
|||
|
||||
app.put(/^\/tags\/[A-z:.-]+$/, function(req, res, next) {
|
||||
var tagName = req.path.substr("/tags/".length);
|
||||
console.log('i am in put and i want to write a tag : ', tagName);
|
||||
state[tagName] = req.text;
|
||||
commit(function(err) {
|
||||
if (err)
|
||||
|
@ -91,7 +93,7 @@ function getUUID() {
|
|||
function getOwnAddress(port, hostname, callback) {
|
||||
var socket = net.createConnection(port, hostname);
|
||||
socket.on('connect', function () {
|
||||
var self = "http://" + socket.address().address + ":" + config.port;
|
||||
var self = "http://" + socket.address().address + ":" + 80;
|
||||
socket.destroy();
|
||||
callback(null, self)
|
||||
});
|
||||
|
@ -127,9 +129,9 @@ function registerWithDirectoryServer() {
|
|||
};
|
||||
|
||||
var req = http.request(options, function(res) {
|
||||
//console.log('STATUS: ' + res.statusCode);
|
||||
//console.log('HEADERS: ' + JSON.stringify(res.headers));
|
||||
//res.setEncoding('utf8');
|
||||
console.log('STATUS: ' + res.statusCode);
|
||||
console.log('HEADERS: ' + JSON.stringify(res.headers));
|
||||
res.setEncoding('utf8');
|
||||
var ret = "";
|
||||
res.on('data', function (chunk) {
|
||||
ret += chunk;
|
||||
|
|
Загрузка…
Ссылка в новой задаче