我想保存我这边用户的入口点。所以这是我的解决方案
Meteor.onConnection(function(conn) {
console.log(conn.clientAddress);
console.log(FlowRouter.getRouteName());
var id = database.insert({
page: "page",
ip: conn.clientAddress,
enterdPagedAt: new Date(),
isActive: true
});
});
正如你所看到的,在页面下,我想保存他输入的路线。那么如何使用流路由器获取服务器上的当前路由?
最佳答案
来自Meteor Guide来个提示:
It’s common to want to know which pages of your app are most commonly visited, and where users are coming from. You can read about how to set up Flow Router based analytics in the Deployment Guide.
即使您不想使用第三方分析服务,okgrow:analytics package他们提到的应该有您需要的信息埋在 its code 中.
关于javascript - Flow Router 获取当前 Router 服务器端,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40764211/