Tag: meteor

如何caching最后加载的数据在cordova应用程序的客户端?

我在Meteor上构build了一个应用程序,并在我的Android设备上testing了我的应用程序。 它工作很好。 我发布我的数据在服务器上,并在客户端订阅。 但是,当我没有数据或服务器closures,移动应用程序显示没有内容。 这是有道理的,因为它不能加载任何东西。 但是,必须能够从服务器caching最后加载的数据,以便在没有连接的情况下,至less可以在移动应用程序中显示某些内容。 我看着appcache,但似乎是资产而不是数据库内容。 有谁知道如何使cordovameteor应用程序的版本在本地caching数据库,所以它也将离线工作?

gcmmeteor的多重通知

我有一个简单的查询。 我在我的meteor开发的应用程序中执行GCM通知。 代码如下 var gcm = Meteor.npmRequire('node-gcm'); var sender = new gcm.Sender('MY_ID'); var message = new gcm.Message(); //message.addData('message',new Date().getTime()); message.addData({'title':'mytitle','message':new Date().getTime()}); message.delay_while_idle = true; var registrationIds = []; registrationIds.push("MY_REG_NO"); sender.send(message, registrationIds, 4, function (err, result) { console.log(result); }); 现在当我从客户端调用这个方法时,我得到了一个正确的通知。 但是当我再次调用这个方法时,之前的通知被最新的通知覆盖。 如何在通知托盘中显示通知列表而不覆盖以前的通知? 提前致谢。

Meteor Fibers在部署到Heroku时不推荐使用

我正在使用我以前的工具buildpack将我的Meteor应用程序部署到Heroku。 我在短时间内没有部署,今天我遇到了问题。 安装NPM依赖项时出现错误。 它说纤维有问题。 这里是日志: —–> Installing dependencies child_process: customFds option is deprecated, use stdio instead. child_process: customFds option is deprecated, use stdio instead. make: Entering directory `/tmp/build_70c8f25c1f62ee4cd50886dedb713437/.heroku/app/programs/server/node_modules/fibers/build' CXX(target) Release/obj.target/fibers/src/fibers.o ../src/fibers.cc:222: error: ISO C++ forbids declaration of 'Arguments' with no type ../src/fibers.cc:222: error: expected ',' or '…' before '&' token ../src/fibers.cc:241: error: ISO C++ forbids […]

全局显示环境(在Web应用程序的前端显示envvariables)

我正在使用Node,而process.env.NODE_ENV在客户端上不可用(进程本身在客户端上不可用)。 告诉客户您在什么环境中的最佳方式是什么?例如开发或生产?

meteorJS获取在服务器发布方法中请求的url

如何获取服务器发布方法中请求的url信息? 可能吗?

meteorJS Jade模板不能按预期工作

我试过这个包https://github.com/matteodem/meteor-easy-search/使用这个示例代码很容易search <template name="searchBox"> {{> esInput index="players" placeholder="Search…" }} <ul> {{#esEach index="players"}} <li>Name of the player: {{name}}</li> {{/esEach}} </ul> </template> 并将其转换为玉石 template(name="searchBox") +esInput index="players" placeholder="Search…" ul esEach index="players" li Name of the player: {{name}} 如果我使用html格式的search工作,但是当我使用玉石格式没有错误,但search将不会显示。 我把html转换成了jade吗? 任何想法为什么玉不起作用?

meteor比较集合中的embedded式数组

我有三个集合: UserCollection , DepartmentCollection和QuestionsCollection QuestionsCollection是一个可configuration的问题列表。 用户和部门各自回答从QuestionsCollection生成的调查,结果每个都有embedded的questionAnswer对象数组,每个对象都有一个questionid和一个answer属性。 UserCollection中的用户文档示例如下: { id:SoEtnNvN8B3QYcd3N, questionAnswers:[ { questionId: 1, answer: "melbourne" }, { questionId: 2, answer: "10"}] } } 部门将具有相同的embedded式数组,但可以包含更多或更less的questionAnswer对象。 当然有不同的或相同的答案。 问题: 我想要做的是能够得到一个单一的用户questionAnswers数组作为search条件,并看看有多less部门匹配这些questionAnswers。 匹配将在两个属性上匹配,并且用户必须回答部门已经回答的相同问题以匹配例如 如果部门回答了比用户更多的问题,那么它自动不会匹配。 如果用户和部门回答相同数量的问题,则所有questionAnswer值应匹配。 如果用户回答了比部门更多的问题,则所有的部门questionAnswers必须包含在用户questionAnswers内。 答案是完全匹配,但我可能需要某种机制来进行范围search。 我已经看了可能build立一个使用用户questionAnswers数组查询和使用$ elemMatchsearchDepartmentCollection,但我不知道如何实现这一点。 任何帮助或方向将不胜感激。

我如何使用Meteor简单模式与meteor页面

刚开始玩meteor,我正在寻找meteor-simple-schema与meteor-pages工作 原理很简单,我只是玩他们提供的示例todos应用程序,并希望添加无限滚动来加载更多的待办事项。 但是我不能同时工作。 这是我的默认meteor-simple-schema Todos = new Meteor.Collection('todos', {}); Schema = {}; Todos.attachSchema(new SimpleSchema({ text: { type: String, label: "Name", max: 200, min: 2 }, createdAt: { type: Date, label: "Created", optional: false }, creatorId: { type: String, label: "Creator", optional: false }, done: { type: Boolean, defaultValue: false, label: "Done?", optional: true } })); […]

黄瓜testing通过没有function存在

我已经开始为Cucumber创build一个Meteor应用程序的testing套件( http://joshowens.me/cucumber-js-and-meteor-the-why-and-how-of-it/ )。 一些testing通过时没有任何function。 例如,testing文件login.feature包含Feature: Allow users to login , Scenario: A user can login with valid information When I click on sign in link 它在文件loginSteps.js被支持: this.When(/^I click on sign in link$/, function (callback) { helper.world.browser. waitForExist('.at-signup', 7000). waitForVisible('.at-signup'). click('.at-signup'). call(callback); }); loginbutton实际上有class="btn btn-default navbar-btn" ,但Velocity说testing通过了858ms。 另一个testing通过url(helper.world.cucumber.mirror.rootUrl + "event/1")虽然没有这样的url。 其他testing失败,但是,如: getText('.user-menu .dropdown-top-level', function (err, username) […]

使用meteor监听webhook服务器端

我已经build立了一个使用iron-router的meteor应用程序,我希望应用程序听从另一个服务的webhook(基本上我build立一个API使用其他服务) 因此,例如,当一个外部网站调用myapp.meteor.com/webhook我想捕捉具体的链接和参数,并做数据的东西。 更新:感谢评论,我发现这个: https : //github.com/iron-meteor/iron-router/blob/devel/Guide.md#server-routing Router.route('/webhooks', { where: 'server' }) .post(function () { console.log(this); this.response.end('Caught you\n'); //this.response.status(200).json({text:"Todo added"}); }); 我在/server文件夹中添加了上面的内容,因为没有必要让前端服务器担心这个,就像评论中提到的一样。 但是,当我加载这个使用postman POST请求,它只是返回我的HTML not found 。 有任何想法吗? 在此先感谢您的帮助。 更新我试着@David说什么,仍然我得到的模板加载,并没有在控制台中。 任何想法我做错了什么?