我有一个Meteor应用程序,可以与Facebook应用程序一起用于用户登录。在实际托管版本上,登录使用实际的Facebook应用程序,但在开发中的localhost中,该应用程序使用Facebook测试应用程序。 问题是,当我从开发切换到部署时,我需要注释掉生产的凭据并取消注释开发凭证。我怎么能解决这个问题?
// Removes the config b/c dupliation error and re-defines it
// Facebook API config
// Since Facebook Test app has been created, wrap this in conditional that only executes if on Amazon server and not localhost
// STRICTLY - Production
// ServiceConfiguration.configurations.remove({
// service: "facebook"
// });
// ServiceConfiguration.configurations.insert({
// service: 'facebook',
// appId: Meteor.settings.FacebookId,
// secret: Meteor.settings.FacebookSecret
// });
// STRICTLY - Dev
ServiceConfiguration.configurations.remove({
service: "facebook"
});
ServiceConfiguration.configurations.insert({
service: 'facebook',
appId: 'id',
secret: 'secret'
});
答案 0 :(得分:0)
您应该将 dev 和 prod 变量添加到df2 <- structure(list(ID = c("Customer 1", "Customer 1", "Customer 1",
"Customer 2", "Customer 2", "Customer 2"), Measure1 = c(30L,
30L, 30L, 32L, 32L, 32L), Measure2 = c(2L, 2L, 2L, 4L, 4L, 4L
), XO = c("item1", "item2", "item4", "item1", "item5", "item7"
), X1 = c("item1", "item1", "item1", "item5", "item1", "item1"
), x2 = c("item5", "item5", "item5", "item1", "item5", "item5"
), x3 = c("item2", "item2", "item2", "item2", "item2", "item7"
), x4 = c("item12", "item12", "item12", "item12", "item12", "item12"
), x = c("item4", "item4", "item4", "item4", "item4", "item4"
), Flag = c(1L, 3L, 5L, 2L, 2L, 3L)), .Names = c("ID", "Measure1",
"Measure2", "XO", "X1", "x2", "x3", "x4", "x", "Flag"), class = "data.frame",
row.names = c(NA,
-6L))
文件中,然后使用/**** tab Camera Controller ***/
.controller('tabCameraCtrl', function($scope, $state, $cordovaCamera) {
/**********function to Open Camera *********/
$scope.openCamera = function() {
document.addEventListener("deviceready", function() {
var options = {
quality: 50,
destinationType: Camera.DestinationType.FILE_URI,
sourceType: Camera.PictureSourceType.CAMERA,
// allowEdit: true,
//encodingType: Camera.EncodingType.JPEG,
targetWidth: 100,
targetHeight: 100,
//popoverOptions: CameraPopoverOptions,
saveToPhotoAlbum: false
// correctOrientation: true
};
$cordovaCamera.getPicture(options).then(function(imageURI) {
var image = document.getElementById('myImage');
image.src = imageURI;
$scope.lastPhoto = imageURI;
window.localStorage.setItem('image',JSON.stringify(imageURI));
console.log('success')
console.log('Image Address');
console.log(imageURI);
}, function(err) {
// error
console.log(err)
});
}, false);
}
在本地加载它们。 settings.json文件看起来像这样:
settings.json
然后您可以像以前一样访问它们:meteor --settings settings.json
。
公共/私人对你的项目可能有点过分(我可能搞砸了括号),但这应该传达一般概念。有关详细信息,请查看此引用的post。