Tag: meteor

meteor包在浏览器上工作,但不在服务器上

使用客户端(浏览器JS控制台)上的Meteor包装strikeout:string.js是没有问题的,但是在服务器端使用它时会引发错误。 检查package.js并findapi.addFiles('lib/string.js', ['client','server']); 这是不够的吗? testing代码 console.log(S('jon').capitalize().s) 错误在服务器上 ReferenceError: S is not defined

图像不在meteor中呈现

我正在使用collectionFs来上传和显示图像。 除了当我尝试在模板中显示图像时,一切都完美无缺。 如果我写{{this.url}}则URL显示完美 /cfs/files/images/GkPAjn98N6izJYc6x/blogging.jpg 但是,如果我写<img src="{{this.url}}">什么都不知道为什么这是什么?

如何提交Google Compute Engine上的代码更改?

我是Google云端新手,我有一个在使用Google Compute Engine部署的nodejs服务器上运行的应用程序。 这是基于Javascript的应用程序。 但是现在,当我需要为我的应用程序更改一些前端代码时,我无法将更改推送到代码中。 我试图连接它与BitBucket,成功,但谷歌没有改变部署的代码库根据bitbucket的变化。 然后我创build了一个谷歌云存储库,做了同样的事情。 我可以看到我在谷歌云存储库中更改的代码,但仍然为我的应用程序部署的代码没有显示任何反映的变化? 我尝试重新启动实例,但徒劳无功。 如何更改我在Google Compute Engine上托pipe的应用的可运行代码库?

collection.find()。属性返回undefined

我有以下代码: var permalinkVar = this.params.permalink; var imageVar = sites.find({'name':permalinkVar}).createdBy; console.log(imageVar); 在一个路由函数内,我试图返回createdBy属性,但我不知道为什么,但它返回undefined 。 谁能帮忙?

meteor观察arrays服务器端

我有一个recursion函数,在服务器端asynchronous构build一棵树,我想“观察”它,每次有变化时,都会重新运行Meteor中的调用方法。 我做了一个简单的例子,用一个recursionreaddir调用来构build一棵树(在实际的应用程序中,每个节点可能需要几分钟的计算,其结果取决于已经探索的节点) 在server / methods.js中 var fs = Meteor.npmRequire('fs') var path = Meteor.npmRequire('path') var tree = function (dir, r) { try { fs.readdir (dir, function (error, files) { if (files && files.length) for (var i = 0; i < files.length; i++) { r[i] = { name : files[i], children : [] } tree(path.resolve(dir, files[i]), r[i].children) […]

在login之后,铁路路由器中的未定义Meteor.userId()

当用户第一次login时加载站点,然后login,下面定义的路由account将parsing为/profile/null 。 用户必须在path正确之前刷新站点。 this.route('account', { template: 'profile', path: '/profile/' + Meteor.userId() }) 创build一个路由,特别是采取参数Meteor.userId()的原因是因为我使用的包 ,需要我定义的path名,即: {{> ionTab title="Account" path="account"}}我不认为可以采取一个参数。 有什么更好的方法来完善这条路线?

返回的方法调用是不确定的?

好的,所以我正在使用一个方法来发出请求,并从另一个URL拉一些表 Meteor.methods({ gimmetitle: function () { var url = 'http://wiki.warthunder.com/index.php?title=B-17G_Flying_Fortress'; request(url, function(err, response, body) { $ = cheerio.load(body); var text = $('.flight-parameters td').text(); console.log(text); return text; }); } }); 当调用表中的td成功打印到服务器控制台时: http : //prntscr.com/721pjh Buuut,当那个文本从该方法返回到这个客户端代码时, undefined被打印到控制台: Template.title.events({ 'click #thebutton': function () { Meteor.call('gimmetitle', function(error, result){ Session.set('gogle', result); }); var avar = Session.get('gogle'); console.log(avar); } }); 想法?

meteor上次在MongoDB中执行查询?

meteor蒙古语和Mongodb查询是一样的。 我正在使用外部Mongodb。 所以我需要debugging我的查询。 他们有没有办法在Mongo中查找最后执行的查询?

在Meteor中:如何使用应该从存储库中提取的npm库?

在我的packages.json文件中,我有: { "sendwithus":"git+https://git@github.com/whalepath/sendwithus_nodejs.git#enable_testing_server" } 因为我需要使用分叉(和固定版本的库)。 上面的语法在直接节点中工作。 如何在meteor中做到这一点? 这是我得到的错误: => Started proxy. => Errors prevented startup: While reading package from `src/packages/npm-container`: package.js:14:7: must declare exact version of dependency: sendwithus@git+https://git@github.com/whalepath/sendwithus_nodejs.git#enable_testing_server 更新: 我试图删除线,并使用meteor添加到包括包: 失败: meteor add sendwithus@2.9.1@https://github.com/whalepath/sendwithus_nodejs/commit/41b0d177f6eabf02de2daec9bb2b36daebbfbef4 => Errors while parsing arguments: While adding package sendwithus@2.9.1@https://github.com/whalepath/sendwithus_nodejs/commit/41b0d177f6eabf02de2daec9bb2b36daebbfbef4: error: Package names can only contain lowercase ASCII alphanumerics, dash, dot, or […]

是否有可能从集合发布具有多个条件字段的项目?

考虑这种情况,我有一个party对象,这个party对象有关于派对,位置,时间,客人等的一些信息字段。它也有一些字段为一些信息字段设置隐私,如showLocation, showGuests等等。这些将隐藏这个信息从没有被邀请的用户。 我怎样才能只发送给客户的“显示”字段为真的字段? 当我发布一个单一的项目,我可以使用这样的事情:(合并不是一个真正的function) Meteor.publish("party", function (_id) { var party = Parties.findOne({_id: _id}); var fields = merge( {name: 1, title: 1, creatorUserId: 1}, (party.showLocationAndDate ? {location: 1, date: 1} : null), (party.showGuests ? {guests: 1} : null) ); return Parties.find({_id: _id}, {fields: fields}); }); 当我发布多个项目,但只有一个条件,我可以使用这样的东西: Meteor.publish("parties", function () { var fieldsWithLocation = { name: 1, […]