问题标签 [kadira]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
147 浏览

meteor - Mupx 使用 settings.json 失败部署

对于那些Digital Ocean用于托管和mupx部署的人:我无法成功实现settings.json文件的使用以在部署时运行。以前它导致部署失败,现在,例如,当我尝试添加 packageokgrow:analytics时,它​​不起作用,并且出现在浏览器控制台上:

Meteor.settings.public中缺少分析设置

虽然它在那里。

在本地运行时,必须键入meteor --settings settings.json才能启动应用程序。有什么等价的mupx吗?我该如何进行相应的配置?

不用说,我需要 settings.json 来存储敏感数据,git 也应该忽略这些数据。也许只是meteor命令应该首先检查是否settings.json存在,然后使用里面的设置(如果有的话)运行。然后就不用打字了meteor --settings settings.json...

0 投票
1 回答
52 浏览

javascript - FlowRouter - 将内容插入 HTML 模板

我正在尝试学习流星反应,我有一个关于使用 FlowRouter 将内容插入 HTML 模板页面的问题。

假设一切都正确导入,这是相关代码:

路线.jsx

index.jsx - MainLayoutCtx 指向的位置

在 index.jsx 中,{content = () => null}。这不是说 content 是一个没有参数并且输出 null 的对象字面量吗?

但是当在 routes.jsx 中传递内容时,它是() => (/Post postId={postId}/>)那么输出 Post 的内容不是将 postId 作为 prop 传入吗?

这与 index.jsx 的预期有何匹配?

0 投票
1 回答
324 浏览

meteor - 备份 MongoDB mup 部署

我已经使用mup deploy成功部署了我的流星应用程序。如访问数据库的文档中所述,我们需要运行以下命令:

如何在此设置中使用 mongodump 命令?我试过跑步

命令运行成功,但我找不到 baza.gz 存档

0 投票
1 回答
376 浏览

javascript - Meteor 1.4.1.1 如何安装 react 和 kadira:react-layout?

我正在尝试安装 react 包,但是当我尝试安装 kadira:react-layout 时,控制台日志返回了同样的问题。我该如何解决?

I20160915-17:27:56.255(2)? [Error: Can't find npm module 'react-addons-transition-group/package.json'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package?] I20160915-17:27:56.257(2)? [Error: Can't find npm module 'react-addons-css-transition-group/package.json'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package?] I20160915-17:27:56.258(2)? [Error: Can't find npm module 'react-addons-linked-state-mixin/package.json'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package?] I20160915-17:27:56.259(2)? [Error: Can't find npm module 'react-addons-create-fragment/package.json'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package?] I20160915-17:27:56.260(2)? [Error: Can't find npm module 'react-addons-update/package.json'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package?] I20160915-17:27:56.260(2)? [Error: Can't find npm module 'react-addons-pure-render-mixin/package.json'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package?] I20160915-17:27:56.261(2)? [Error: Can't find npm module 'react-addons-test-utils/package.json'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package?] I20160915-17:27:56.262(2)? [Error: Can't find npm module 'react-addons-perf/package.json'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package?] W20160915-17:27:56.263(2)? (STDERR) WARNING: npm peer requirements (for react-runtime) not installed: W20160915-17:27:56.264(2)? (STDERR) - react-addons-transition-group@15.x not installed. W20160915-17:27:56.264(2)? (STDERR) - react-addons-css-transition-group@15.x not installed. W20160915-17:27:56.264(2)? (STDERR) - react-addons-linked-state-mixin@15.x not installed. W20160915-17:27:56.265(2)? (STDERR) - react-addons-create-fragment@15.x not installed. W20160915-17:27:56.265(2)? (STDERR) - react-addons-update@15.x not installed. W20160915-17:27:56.266(2)? (STDERR) - react-addons-pure-render-mixin@15.x not installed. W20160915-17:27:56.266(2)? (STDERR) - react-addons-test-utils@15.x not installed. W20160915-17:27:56.266(2)? (STDERR) - react-addons-perf@15.x not installed. W20160915-17:27:56.266(2)? (STDERR) W20160915-17:27:56.267(2)? (STDERR) Read more about installing npm peer dependencies: W20160915-17:27:56.267(2)? (STDERR) http://guide.meteor.com/using-packages.html#peer-npm-dependencies W20160915-17:27:56.267(2)? (STDERR) W20160915-17:27:56.513(2)? (STDERR) /Users/ortiz/.meteor/packages/meteor-tool/.1.4.1_1.1h0re2h++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:280 W20160915-17:27:56.514(2)? (STDERR) throw(ex); W20160915-17:27:56.514(2)? (STDERR) ^ W20160915-17:27:56.514(2)? (STDERR) W20160915-17:27:56.515(2)? (STDERR) Error: Can't find npm module 'react-addons-transition-group'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package? W20160915-17:27:56.515(2)? (STDERR) at Object.Npm.require (/Users/ortiz/Siti/tutorial/meteor/react/flowrouter/.meteor/local/build/programs/server/boot.js:198:17) W20160915-17:27:56.515(2)? (STDERR) at options.fallback (packages/modules-runtime/modules-runtime.js:21:1) W20160915-17:27:56.515(2)? (STDERR) at require (packages/modules-runtime/.npm/package/node_modules/install/install.js:88:1) W20160915-17:27:56.516(2)? (STDERR) at meteorInstall.node_modules.meteor.react-runtime.react-runtime.js (packages/react-runtime/react-runtime.js:29:20) W20160915-17:27:56.517(2)? (STDERR) at fileEvaluate (packages/modules-runtime/.npm/package/node_modules/install/install.js:153:1) W20160915-17:27:56.517(2)? (STDERR) at require (packages/modules-runtime/.npm/package/node_modules/install/install.js:82:1) W20160915-17:27:56.517(2)? (STDERR) at /Users/ortiz/Siti/tutorial/meteor/react/flowrouter/.meteor/local/build/programs/server/packages/react-runtime.js:79:15 W20160915-17:27:56.517(2)? (STDERR) at /Users/ortiz/Siti/tutorial/meteor/react/flowrouter/.meteor/local/build/programs/server/packages/react-runtime.js:92:3 W20160915-17:27:56.517(2)? (STDERR) at /Users/ortiz/Siti/tutorial/meteor/react/flowrouter/.meteor/local/build/programs/server/boot.js:292:10 W20160915-17:27:56.518(2)? (STDERR) at Array.forEach (native) => Exited with code: 1

0 投票
1 回答
115 浏览

reactjs - 流星路由器扔空白页

我是流星流量路由器的新手。

我正在尝试将 kadira flow-Router 和 react-mounter 实现到我的自定义用户帐户应用程序中。虽然我的应用程序中安装了 DOM 和 Mounter,但我发现它们在我的应用程序中丢失了。

启动服务器后,页面变为空白且不呈现。

我附上了屏幕截图。

请指导。

应用程序崩溃屏幕截图

流路由器设置屏幕截图 包装屏幕截图

0 投票
1 回答
321 浏览

mongodb - Meteor 中的 Oplog 拖尾 - 做还是不做?

我正在尝试协调这篇kadira.io文章,该文章说 oplog 拖尾是每个 Meteor 生产应用程序都必须使用这篇compose.io文章 - 请参阅“To Oplog or not Oplog”部分,它说您应该只在某些情况下使用 oplog。

基本上我有一个流星应用程序,它没有大量用户或大量连续写入收藏。

然而,它确实需要从数据库中读取大量数据,这似乎会减慢速度。

据我所知,它只在一台服务器上运行。

我想知道添加 oplog 拖尾会加快速度吗?

提前致谢。

0 投票
3 回答
1615 浏览

meteor - 如何使用 blaze-layout 渲染将数据传递给模板?

我尝试使用以下代码将数据传递给模板并接收它,onCreated()但我无法访问数据。

但我明白了TypeError: Cannot read property 'attr' of undefined。我哪里错了?

0 投票
1 回答
83 浏览

meteor - Meteor 方法等待不存在的订阅

我有一个 Meteor 方法generateUserHash,它只是将一个 ID 传递给Intercom以取回用户哈希:

根据卡迪拉的说法:

在此处输入图像描述

我不明白为什么当这些订阅不在方法中时,它为什么要等待所有这些订阅。

0 投票
0 回答
69 浏览

mongodb - 为什么在 Meteor 中获取这么多文件?

我的应用程序正在从 Meteor 中的服务器获取大量文档。我已经尝试优化实时查询以减少这种情况,但是当 collection.find().count() 仅为 13 时,我每小时仍会收到数千个文档。

在此处输入图像描述

订阅

出版

上下文中的用法

0 投票
0 回答
117 浏览

meteor - 在流星js中使用子域作为用户名

问题

在创建帐户时,我希望用户以 username.domain-name.com 的身份访问他们的个人资料

我也有网站功能:

如果上面的用户允许他访问,上面的链接可能包含其他用户可以访问的内容。

示例: user1.domain-name.com/feature1,此处 user1 已授予 user2 访问权限 因此,user2 已登录并在访问user1.domain-name.com/feature1时应该能够看到内容。

到目前为止我的研究:

我尝试了以下链接:

https://kadira.io/blog/meteor/sharing-meteor-login-state-between-sub-domains https://github.com/jfrolich/meteor-subdomain-persistent-login

看了很多,发现meteor有localStorage作为存储用户登录信息的方式。所以,我必须设法将详细信息传递给子域。我还尝试在 nginx 配置中使用 proxy_pass 来执行以下操作:请求: username.domain-name.com/feature1应该代理到(不重定向 URL 将是相同的)domain-name.com/username/feature1

如果有人在这里对我应该使用的方法有所了解,那真的会对我有所帮助。

我知道这种设计可能不适合搜索引擎。

更新

我现在成功地使用了以下设计:如果 user1 在 domain-name.com 登录并想要访问他自己的个人资料页面,例如 user1.domain-name.com/profile。

第 1 步:user1 访问 user1.domain-name.com/profile 它重定向到 domain-name.com,其中 user1 在 localstorage 中有会话,然后读取 HTTP 标头引用我得到 user1.domain-name.com/profile 并准备新的 url:user1。 domain-name.com/profile?token=userToken (我可能会在数据库中创建另一个临时令牌,只需单击一次。)

步骤 2:重定向到新的 url user1.domain-name.com/profile?token=userToken,使用 get 参数我在本地存储中创建新会话并将 user1 重定向回 user1.domain-name.com/profile。

这是一个非常规的解决方案,我还在重新寻找。