Skip to content

Instantly share code, notes, and snippets.

@wsrzx
Created February 9, 2016 22:23
Show Gist options
  • Save wsrzx/465d5e690330d7c8151c to your computer and use it in GitHub Desktop.
Save wsrzx/465d5e690330d7c8151c to your computer and use it in GitHub Desktop.
Como publicar um Web App construído com Node.JS no Azure App Service partindo do OSX
{
"name": "Partiu Azure",
"version": "0.0.1",
"description": "",
"main": "./server.js",
"engines": { "node": ">= 0.6.0" }
}
var http = require('http');
var port = process.env.port || 1337;
http.createServer(function (req, res) {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end(‘Partiu Azure =) \n’);
}).listen(port);
<?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