meteor

Generating a PDF file from React Components

纵饮孤独 提交于 2019-12-17 17:32:53
问题 I have been building a polling application. People are able to create their polls and get data regarding the question(s) they ask. I would like to add the functionality to let the users download the results in the form of a PDF. For example I have two components which are responsible for grabbing the question and data. <QuestionBox /> <ViewCharts /> I'm attempting to output both components into a PDF file. The user can then download this PFD file. I have found a few packages that permit the

Meteor with iron-router cant get slick carousel working

旧城冷巷雨未停 提交于 2019-12-17 16:55:26
问题 I am using iron-router, i have a route "models" which has a list of items. When the user clicks one of these items a new route "model" is used, the name of the selected item is passed as a param and used to load data about that model from the database. I want to use slick carousel, using an array of images returned from the database (based on the param). <div id="carousel"> {{#each images}} <div class="item"> <img src="/images/{{this}}" alt=""> </div> {{/each}} </div> Where should I call the

Meteor.js and Google Maps

孤者浪人 提交于 2019-12-17 15:42:43
问题 i already included maps api into my project. Now i want to show some markers on my map. I initialse my map in a startup function: Meteor.startup(function() { ... var mapOptions = { zoom: 8, mapTypeId: google.maps.MapTypeId.ROADMAP }; Map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions); Than i set the center of the map on rendering Template.mapPostsList.rendered = function() { var p2 = Session.get('location'); Map.setCenter(new google.maps.LatLng(p2.lat, p2.lng)); var

Meteor bundle fails because fibers.node is missing

倾然丶 夕夏残阳落幕 提交于 2019-12-17 15:42:22
问题 The bundled node.fibers fails to load after deployment to a different server with the following error: /home/ec2-user/bundle/server/node_modules/fibers/fibers.js:13 throw new Error('`'+ modPath+ '.node` is missing. Try reinstalling `node-fibe ^ Error: `/home/ec2-user/bundle/server/node_modules/fibers/bin/linux-x64-v8-3.11/fibers.node` is missing. Try reinstalling `node-fibers`? at Object.<anonymous> (/home/ec2-user/bundle/server/node_modules/fibers/fibers.js:13:8) at Module._compile (module

How to serve static content (images, fonts etc.) using iron router

半世苍凉 提交于 2019-12-17 15:38:48
问题 I just started working with iron router on meteor. I need to show an image on homepage. I was able to configure route for 'home' using the client side routing. For static files I tried to google and found that adding a server side route might help. So, I added the following code on server's router.js. Router.map(function() { this.route('files', { path: '/files/:path(*)', action: function() { var path = this.params.path; console.log('will serve static content @ '+path); this.response.sendfile

Meteor.js deploy to “example.com” or “www.example.com”?

泪湿孤枕 提交于 2019-12-17 15:06:22
问题 I recently deployed a meteor app using the following command: $ meteor deploy example.com and later (thinking that it was the same) using the following: $ meteor deploy www.example.com It end up serving two different versions of the app, one hosted in "example.com" and other hosted in "www.example.com". Can I revert one of the deploys? Which one should I revert? If not, what kind of configs should I set on my domain provider? Thank you, Joao 回答1: When people go to your page, do you want them

Is there a post createUser hook in meteor when using accounts-ui package?

雨燕双飞 提交于 2019-12-17 10:59:09
问题 Let's say I have a todo app, and I want to make sure that every user that registers has at least one todo to start with, something like "First todo to cross off!", how would I do that in meteor? In general, the way I see it, I can do it when the user is created for the first time (ideal), or check to see whether they need a new todo every time they log in (less ideal). In the latter case, I can do a check for Todos.findOne() , and if the count is 0, add one. However, seems that whether I do

How to publish a view/transform of a collection in Meteor?

為{幸葍}努か 提交于 2019-12-17 10:49:28
问题 I have made a collection var Words = new Meteor.Collection("words"); and published it: Meteor.publish("words", function() { return Words.find(); }); so that I can access it on the client. Problem is, this collection is going to get very large and I just want to publish a transform of it. For example, let's say I want to publish a summary called "num words by length", which is an array of ints, where the index is the length of a word and the item is the number of words of that length. So

How can I debug my Meteor app using the WebStorm IDE?

ぐ巨炮叔叔 提交于 2019-12-17 10:25:23
问题 Can anyone provide a short list of steps on how to connect a Meteor app to the WebStorm debugger please? 回答1: WebStorm is the only IDE with native support for debugging Meteor server code - check this video. Even on Windows, debugging is very simple: WebStorm 9+ Go to Run --> Debug --> Edit configurations... , click the plus sign, click "Meteor". You can add environment variable like ROOT_URL if you need to. WebStorm older than 9 This answer is kept only for historical purposes. You should

Verify user password in Meteor

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-17 09:42:04
问题 There are some irreversible actions that user can do in my app. To add a level of security, I'd like to verify that the person performing such an action is actually the logged in user. How can I achieve it? For users with passwords, I'd like a prompt that would ask for entering user password again. How can I later verify this password, without sending it over the wire? Is a similar action possible for users logged via external service? If yes, how to achieve it? 回答1: I can help with the first