如何指定托管在Azure上的Web应用程序node.exe.config? [英] How do I specify node.exe.config for web app hosted on azure?

查看:189
本文介绍了如何指定托管在Azure上的Web应用程序node.exe.config?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经部署到Azure中的节点服务器和正在使用Edge.js做出一些WCF调用。当我本地托管的服务器上,建议一切都很正常,因为我可以把.NET配置在旁边我的本地node.exe node.exe.config的Web服务调用<一个href=\"http://stackoverflow.com/questions/17170174/load-wcf-app-config-bindings-in-edge-js-app/23480481#23480481\">here.

I have a node server deployed to azure and am using Edge.js to make some WCF calls. When I host the server locally, everything works great because I can put the .NET config for the web service calls in node.exe.config located next to my local node.exe as recommended here.

不过,这似乎并没有对于托管在Azure中的节点服务器是可行的。 Azure的似乎并没有让用户随意把文件放在自己的文件系统上的任何计算机用户的服务器恰好是当前正在运行(这是完全合理的)。有没有一种方法,我可以告诉边缘或要查找的节点的配置在不同的位置?

However, this does not seem feasible for a node server hosted on azure. Azure doesn't seem to let user arbitrarily put files on their file systems on whatever machine the user's server happens to be currently running on (which is completely reasonable). Is there a way I can tell edge or node to look for the config in a different location?

推荐答案

首先,我们应该看看是否你的WCF调用可以从公共网络通过WCF的端点被称为呼叫。

At first, we should check out whether your WCF calls can be called from public network via the endpoint of the WCF calls.

如果我们可以称之为通过端点WCF调用,我们可以直接调用它的Node.js。

If we can call the WCF call via the endpoint, we can directly call it in node.js.

现在我有一个WCF REST服务的端点
的http:// IP:端口/ Service.svc /选择类型= -1,这里即将在节点调用这个服务我的code片段。 JS:

Now I have an endpoint of WCF REST service like "http://IP:port/Service.svc/Select?type=-1", and here is my code snippet about calling this service in node.js:

router.get('/wcfCall', function (req, res, next) {
    var request = require('request');
    var r = request('http://IP:port/Service.svc/Select?type=-1');
    r.on('data', function(data) {
        console.log('decoded chunk: ' + data)
    })
    .on('response', function(response) {
        response.on('data', function(data) {
            console.log('received ' + data.length + ' bytes of compressed data')
        })
    })
})  

这篇关于如何指定托管在Azure上的Web应用程序node.exe.config?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆