我一直在挠头,试图为我的Iron cli生成的项目改编fs系列。
Iron cli使用Iron Router。 这是我正在关注的教程https://medium.com/@victorleungtw/how-to-upload-files-with-meteor-js-7b8e811510fa#.mdionmurk
第一个片段
var imageStore = new FS.Store.GridFS(“images”);
Images = new FS.Collection(“images”, {
stores: [imageStore]
});
第二个是拒绝/允许规则
Images.deny({
insert: function(){
return false;
},
update: function(){
return false;
},
remove: function(){
return false;
},
download: function(){
return false;
}
});
Images.allow({
insert: function(){
return true;
},
update: function(){
return true;
},
remove: function(){
return true;
},
download: function(){
return true;
}
});
第一个代码段应该去哪里,第二个代码段应该去哪里?如果有人想知道iron-cli的结构,这就是https://github.com/iron-meteor/iron-cli的样子
根据生成的结构,您的第一个代码段将进入app/lib/collections
,第二个代码片段将进入app/server/collections
。