{"action":"created","issue":{"url":"https://api.github.com/repos/totaljs/framework/issues/596","repository_url":"https://api.github.com/repos/totaljs/framework","labels_url":"https://api.github.com/repos/totaljs/framework/issues/596/labels{/name}","comments_url":"https://api.github.com/repos/totaljs/framework/issues/596/comments","events_url":"https://api.github.com/repos/totaljs/framework/issues/596/events","html_url":"https://github.com/totaljs/framework/issues/596","id":280504657,"number":596,"title":"request timeout when using couchbase sdk","user":{"login":"Pourya8366","id":7686319,"avatar_url":"https://avatars1.githubusercontent.com/u/7686319?v=4","gravatar_id":"","url":"https://api.github.com/users/Pourya8366","html_url":"https://github.com/Pourya8366","followers_url":"https://api.github.com/users/Pourya8366/followers","following_url":"https://api.github.com/users/Pourya8366/following{/other_user}","gists_url":"https://api.github.com/users/Pourya8366/gists{/gist_id}","starred_url":"https://api.github.com/users/Pourya8366/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pourya8366/subscriptions","organizations_url":"https://api.github.com/users/Pourya8366/orgs","repos_url":"https://api.github.com/users/Pourya8366/repos","events_url":"https://api.github.com/users/Pourya8366/events{/privacy}","received_events_url":"https://api.github.com/users/Pourya8366/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-12-08T14:22:06Z","updated_at":"2017-12-09T07:52:57Z","closed_at":null,"author_association":"NONE","body":"I download the empty project and add the couchbase node.js sdk, then i want to add some data in a bucket in a route, but when i call that route, response would be request timeout!\r\n\r\nthis is the default controller, my question is how i can use couchbase properly in totaljs?\r\n\r\n```JavaScript\r\nvar couchbase = require(\"couchbase\");\r\nvar cluster = new couchbase.Cluster(\"couchbase://localhost/\");\r\ncluster.authenticate(\"admin\", \"123456\");\r\nvar bucket = cluster.openBucket(\"test\");\r\n\r\nexports.install = function() {\r\n  F.route(\"/\", view_index);\r\n  // or\r\n  // F.route('/');\r\n};\r\n\r\nfunction view_index() {\r\n  var self = this;\r\n  console.log(\"here\");\r\n  bucket.insert(\r\n    \"roles\",\r\n    {\r\n      test: 1234\r\n    },\r\n    function(err, result) {\r\n      if (err) {\r\n        console.log(\"err: \" + err);\r\n        self.json({ status: 400 });\r\n      } else {\r\n        console.log(\"success1\");\r\n        self.json({ status: 200 });\r\n      }\r\n    }\r\n  );\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/totaljs/framework/issues/comments/350431031","html_url":"https://github.com/totaljs/framework/issues/596#issuecomment-350431031","issue_url":"https://api.github.com/repos/totaljs/framework/issues/596","id":350431031,"user":{"login":"Pourya8366","id":7686319,"avatar_url":"https://avatars1.githubusercontent.com/u/7686319?v=4","gravatar_id":"","url":"https://api.github.com/users/Pourya8366","html_url":"https://github.com/Pourya8366","followers_url":"https://api.github.com/users/Pourya8366/followers","following_url":"https://api.github.com/users/Pourya8366/following{/other_user}","gists_url":"https://api.github.com/users/Pourya8366/gists{/gist_id}","starred_url":"https://api.github.com/users/Pourya8366/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pourya8366/subscriptions","organizations_url":"https://api.github.com/users/Pourya8366/orgs","repos_url":"https://api.github.com/users/Pourya8366/repos","events_url":"https://api.github.com/users/Pourya8366/events{/privacy}","received_events_url":"https://api.github.com/users/Pourya8366/received_events","type":"User","site_admin":false},"created_at":"2017-12-09T07:52:57Z","updated_at":"2017-12-09T07:52:57Z","author_association":"NONE","body":"Problem solved!\r\ni just have to add the couchbase port which is 8091 in default to the cluster argument for finding it! \r\n```Java Script\r\nvar cluster = new couchbase.Cluster(\"couchbase://localhost:8091/\");\r\n```\r\nand when i check in more, i find out the insert execute after many seconds and the output will be `success1` because it takes long for couch to find the cluster without port explicitly written!"}}
{"actor":{"display_login":"Pourya8366"}}