获取totalJS Flow中的参数?

问题描述 投票:0回答:1

我想得到我的流量参数,例如,http://localhost:8000/?param1=12

如果我想在我的应用程序中使用param1,我该怎样以及在哪里可以做到这一点?

谢谢。

马克桑斯

flow total.js
1个回答
0
投票
  • 安装httproute组件
  • 编辑路线选项,添加您的终端,例如/endpoint/ +检查respond automatically
  • 添加code组件并与HTTP route连接
  • code你可以使用:
// now can get a value from query arguments
value.query.param1

// Performs next proccessing
send(0, value);

或者您可以使用httplistener组件,但此组件捕获所有请求。 httplistener包含与httproute相同的属性。

© www.soinside.com 2019 - 2024. All rights reserved.