So, here is my situation.This is my first time deploying a node application in Windows. So, far I have been frustrated to the extreme. The problem is routing the url. I have written a very simple testapplication and wanted to test it in Windows after deploying it in IIS node. But then for some reason, I keep getting this error "cannot GET (whatever I key in)" This is what I tried so far web.config file-
<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>
<!-- 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:
-->
<rewrite>
<rules>
<rule name="myapp">
<match url="myapp/*" />
<action type="Rewrite" url="hello.js" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
server file (hello.js)-
var express = require('express');
var app = express.createServer();
app.get('/myapp/foo', function (req, res) {
res.send('Hello from foo! [express sample]');
});
app.get('/myapp/bar', function (req, res) {
res.send('Hello from bar! [express sample]');
});
app.listen(process.env.PORT);
After trying this - This is what I get
1. http://localhost:4500/node/TestApp/myapp/foo
- "Cannot GET /node/TestApp/myapp/foo"
2. http://localhost:4500/node/TestApp/myapp
- "Cannot GET /node/TestApp/myapp"
Please help me out of this mess.