我的请求听起来微不足道,但我找不到办法.我输入了一个JSON对象数组:
[
{
"foo": 1,
"bar": 2
},
{
"foo": 3,
"bar": 4
},
(...)
]
Run Code Online (Sandbox Code Playgroud)
我想要输出相同的JSONL版本,即每行一个对象,而不是数组:
{ "foo": 1, "bar": 2 }
{ "foo": 3, "bar": 4 }
(...)
Run Code Online (Sandbox Code Playgroud)
这是不一样的使用--compact-output
,因为这将保护阵列,并给我:
[ { "foo": 1, "bar": 2 }, { "foo": 3, "bar": 4 }, (...) ]
Run Code Online (Sandbox Code Playgroud)
先感谢您.
所有,我几周前在Meteor的GitHub页面上发布了这个问题,但没有得到答案.这个问题看起来很简单,也许没有人能相信我.
以下是重现该问题的步骤.我用以下方法创建了一个名为"foo"的全新香草流星项目:
meteor create foo
Run Code Online (Sandbox Code Playgroud)
我在其中创建了一个文件夹'public'并在其中复制了一张图片(troll.jpg).
然后我专门编辑了foo.html 以显示图片.我从流星的例子中看到,与公共文件夹中的内容对应的URL只是/.
<head>
<title>foo</title>
</head>
<body>
<img src="/troll.jpg">
</body>
Run Code Online (Sandbox Code Playgroud)
我删除了我不使用的foo.js和foo.css.
然后我启动流星,页面只显示一个破碎的图像占位符.网络浏览器的控制台(适用于MacOS的Chrome 20.0.1132.47)说:
Resource interpreted as Image but transferred with MIME type text/html: "http://localhost:3000/troll.jpg". innerhtml.js:80
_htmlToFragment innerhtml.js:80
Meteor.ui.render liveui.js:33
(anonymous function) template.foo.js:1
ready startup_client.js:9
Run Code Online (Sandbox Code Playgroud)
使用Safari我也一样.Meteor在GitHub上的示例似乎没有问题.我究竟做错了什么?谢谢.
G.