Fetching latest commit…
Cannot retrieve the latest commit at this time.


    <title>urlrewrite sample</title>
            background-color: eeeeee
        This sample demonstrates the use of IIS URL rewrite module to redirect an entire
        branch of the URL namespace to a single node.js application. This mechanism allows
        more control over the URL structure of a node.js web service as well as removes
        the *.js file name from the URL.</p>
    visit the endpoint at <a href="myapp/foo/bar/baz">myapp/foo/bar/baz</a><br />
    visit the endpoint at <a href="myapp/1/2/3?param=4">myapp/1/2/3?param=4</a><br />
    debug the hello.js application at <a href="hello.js/debug" target="_blank">hello.js/debug</a> (requires WebKit enabled browser)<br />
    <pre>var http = require('http');

http.createServer(function (req, res) {
    res.writeHead(200, {'Content-Type': 'text/html'});
    res.end('Hello from urlrewrite sample. Request path: ' + req.url);

    &lt;!-- indicates that the hello.js file is a node.js application 
    to be handled by the iisnode module --&gt;

      &lt;add name="iisnode" path="hello.js" verb="*" modules="iisnode" /&gt;

    &lt;!-- use URL rewriting to redirect the entire branch of the URL namespace
    to hello.js node.js application; for example, the following URLs will 
    all be handled by hello.js:
        &lt;rule name="myapp"&gt;
          &lt;match url="myapp/*" /&gt;
          &lt;action type="Rewrite" url="hello.js" /&gt;