Created
July 26, 2012 07:42
-
-
Save SyntaxC4/3180793 to your computer and use it in GitHub Desktop.
Accessing Portal Set App Settings from PHP and Node.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head><title>Accessing App Settings from PHP</title></head> | |
<body> | |
<h1>Hello from <?php echo getenv("CloudProvider"); ?></h1> | |
<ul> | |
<li><label>Service Bus Namespace:</label> <?php echo getenv("ServiceBusConnectionString"); ?></li> | |
<li><label>Storage Connection String:</label> <?php echo getenv("StorageConnectionString"); ?> | |
</ul> | |
<p>Happy Clouding!</p> | |
<p><?php echo getenv("Developer"); ?></p> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "HelloWorld", | |
"version": "0.0.1", | |
"description": "", | |
"main": "./server.js", | |
"engines": { "node": ">= 0.6.0" } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
var port = process.env.port || 1337; | |
http.createServer(function(req, res) { | |
res.write('<p>Hello from ' + process.env.CloudProvider +' </p>'); | |
res.write('<ul>'); | |
res.write('<li><label>Service Bus Namespace:</label>'+ process.env.ServiceBusConnectionString +' </li>'); | |
res.write('<li><label>Storage Connection String:</label>'+ process.env.StorageConnectionString +' </li>'); | |
res.write('</ul>'); | |
res.write('<p>Happy Clouding!</p>'); | |
res.end('<p>'+ process.env.Developer +'</p>'); | |
}).listen(port); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<configuration> | |
<system.webServer> | |
<modules runAllManagedModulesForAllRequests="false" /> | |
<!-- indicates that the server.js file is a node.js application | |
to be handled by the iisnode module --> | |
<handlers> | |
<add name="iisnode" path="server.js" verb="*" modules="iisnode" /> | |
</handlers> | |
<rewrite> | |
<rules> | |
<clear /> | |
<rule name="app" enabled="true" patternSyntax="ECMAScript" stopProcessing="true"> | |
<match url="server\.js.+" negate="true" /> | |
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" /> | |
<action type="Rewrite" url="server.js" /> | |
</rule> | |
</rules> | |
</rewrite> | |
</system.webServer> | |
</configuration> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment