-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 4d2821e
Showing
5 changed files
with
122 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) Microsoft Corporation. All rights reserved. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
var http = require('http'); | ||
|
||
var server = http.createServer(function(request, response) { | ||
|
||
response.writeHead(200, {"Content-Type": "text/plain"}); | ||
response.end("Hello World!"); | ||
|
||
}); | ||
|
||
var port = process.env.PORT || 1337; | ||
server.listen(port); | ||
|
||
console.log("Server running at http://localhost:%d", port); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "app-service-hello-world", | ||
"description": "Simple Hello World Node.js sample for Azure App Service", | ||
"version": "0.0.1", | ||
"private": true, | ||
"license": "MIT", | ||
"author": "Microsoft", | ||
"engines": { | ||
"node": ">=6.9.1" | ||
}, | ||
"scripts": { | ||
"start": "node index.js" | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name" : "worker", | ||
"script" : "./index.js", | ||
"instances" : 1, | ||
"merge_logs" : true, | ||
"log_date_format" : "YYYY-MM-DD HH:mm Z", | ||
"watch": true, | ||
"watch_options": { | ||
"followSymlinks": true, | ||
"usePolling" : true, | ||
"interval" : 5 | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
This configuration file is required if iisnode is used to run node processes behind | ||
IIS or IIS Express. For more information, visit: | ||
https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/web.config | ||
--> | ||
|
||
<configuration> | ||
<system.webServer> | ||
<!-- Visit http://blogs.msdn.com/b/windowsazure/archive/2013/11/14/introduction-to-websockets-on-windows-azure-web-sites.aspx for more information on WebSocket support --> | ||
<webSocket enabled="false" /> | ||
<handlers> | ||
<!-- Indicates that the server.js file is a node.js site to be handled by the iisnode module --> | ||
<add name="iisnode" path="index.js" verb="*" modules="iisnode"/> | ||
</handlers> | ||
<rewrite> | ||
<rules> | ||
<!-- Do not interfere with requests for node-inspector debugging --> | ||
<rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true"> | ||
<match url="^index.js\/debug[\/]?" /> | ||
</rule> | ||
|
||
<!-- First we consider whether the incoming URL matches a physical file in the /public folder --> | ||
<rule name="StaticContent"> | ||
<action type="Rewrite" url="public{REQUEST_URI}"/> | ||
</rule> | ||
|
||
<!-- All other URLs are mapped to the node.js site entry point --> | ||
<rule name="DynamicContent"> | ||
<conditions> | ||
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True"/> | ||
</conditions> | ||
<action type="Rewrite" url="index.js"/> | ||
</rule> | ||
</rules> | ||
</rewrite> | ||
|
||
<!-- 'bin' directory has no special meaning in node.js and apps can be placed in it --> | ||
<security> | ||
<requestFiltering> | ||
<hiddenSegments> | ||
<remove segment="bin"/> | ||
</hiddenSegments> | ||
</requestFiltering> | ||
</security> | ||
|
||
<!-- Make sure error responses are left untouched --> | ||
<httpErrors existingResponse="PassThrough" /> | ||
|
||
<!-- | ||
You can control how Node is hosted within IIS using the following options: | ||
* watchedFiles: semi-colon separated list of files that will be watched for changes to restart the server | ||
* node_env: will be propagated to node as NODE_ENV environment variable | ||
* debuggingEnabled - controls whether the built-in debugger is enabled | ||
See https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/web.config for a full list of options | ||
--> | ||
<!--<iisnode watchedFiles="web.config;*.js"/>--> | ||
</system.webServer> | ||
</configuration> |