-
Notifications
You must be signed in to change notification settings - Fork 0
davidebbo-test/NodeHelloWorld
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
<html> <head> <title>helloworld sample!</title> <style> pre { background-color: eeeeee; } </style> </head> <body> <h2> helloworld</h2> <p> The title says it all. Key points are:</p> <ul> <li>An IIS handler for node.js must be registered in web.config to designate the hello.js file as a node.js application. This allows other *.js files in this web application to be served by IIS as static client side JavaScript files.</li> <li>The node.js listen address must be specified as 'process.env.PORT' when starting the listener. When an application is hosted in IIS, the web server controls the base address of the application, which is provided to the node process via an environment variable. </li> <li>node.js applications can exist side by side with other content types: HTML files, client side JavaScript files, ASP.NET, PHP, WCF, ...</li> </ul> visit the node.js endpoint at <a href="hello.js">hello.js</a><br /> get a client side JavaScript file from <a href="helloClient.js">helloClient.js</a> <p> <b>code</b></p> <pre>var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/html'}); res.end('Hello, world! [helloworld sample; iisnode version is ' + process.env.IISNODE_VERSION + ', node version is ' + process.version + ']'); }).listen(process.env.PORT); </pre> <p> <b>web.config</b></p> <pre><configuration> <system.webServer> <!-- indicates that the hello.js file is a node.js application to be handled by the iisnode module --> <handlers> <add name="iisnode" path="hello.js" verb="*" modules="iisnode" /> </handlers> </system.webServer> </configuration></pre> </body> </html>
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published