Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/457.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 流星可以';t从json文件加载设置_Javascript_Json_Meteor_Ecmascript 6 - Fatal编程技术网

Javascript 流星可以';t从json文件加载设置

Javascript 流星可以';t从json文件加载设置,javascript,json,meteor,ecmascript-6,Javascript,Json,Meteor,Ecmascript 6,我基于以下内容创建了以下settings.json文件: { "azure":{ "container":"The container to store the data", "account":"The account name", "key":"The key that is used for authentication" } } import { Meteor } from 'meteor/meteor'; export const

我基于以下内容创建了以下
settings.json
文件:

{
    "azure":{
      "container":"The container to store the data",
      "account":"The account name",
      "key":"The key that is used for authentication"
    }
}
import { Meteor } from 'meteor/meteor';

export const FileUploadSettings= {
  'container': Meteor.settings.azure.container,
  'account': Meteor.settings.azure.account,
  'key': Meteor.settings.azure.key
}
我还创建了一个名为
imports/settings/fileUploadSettings.js的文件,该文件包含以下内容:

{
    "azure":{
      "container":"The container to store the data",
      "account":"The account name",
      "key":"The key that is used for authentication"
    }
}
import { Meteor } from 'meteor/meteor';

export const FileUploadSettings= {
  'container': Meteor.settings.azure.container,
  'account': Meteor.settings.azure.account,
  'key': Meteor.settings.azure.key
}
之后,我使用以下命令运行它:

meteor --settings=./settings.json
但是当我访问时,我得到以下错误:

TypeError:Meteor.settings.azure未定义


如果要访问客户端上的变量,必须将变量放置在
public
部分

如果要访问客户端上的变量,必须将变量放置在
public
部分

是否尝试了
meteor--settings settings.json
?如果要访问客户端上的变量,您必须将变量放入
public
section@none最后,这就是答案。请在下面提交。您是否尝试过
meteor--settings settings.json
?如果您想访问客户端上的变量,您必须将变量放置在
public
section@none最后,这就是答案。请在下面提交。