简体   繁体   中英

How do I specify node.exe.config for web app hosted on azure?

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 .

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?

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

If we can call the WCF call via the endpoint, we can directly call it in node.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')
        })
    })
})  

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM