-
Notifications
You must be signed in to change notification settings - Fork 582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keep getting "Cannot GET" error with iisnode and Express #160
Comments
The immediate cause of the issue is that you don't seem to have a route registered for the '/myapp.js' path in your express app. However, the big picture is that in case of a node.js app hosted in iisnode, and Express app in particular, you probably want to have the entire URL space redirected to the entry point of your application. For that, you need to use URL rewriting in IIS. I suggest starting with the following boilerplate web.config:
What this does is the following:
Requests for all other URLs (e.g. /a/b/c?foo=12) will now be sent to the server.js application and will be handled following the logic implemented there. In case of an Express app, express routes will apply. |
Thank you very much for your quick response.. The web.config seems to have fixed my issues. |
In my Case do i have to write the rewrite rules for all the paths or only for main files. Having hard time putting node js application on IIS server. thank you var mysql= require('mysql'); //app.use is to define the pages and folder and basic usage app.use(bodyParser.json()); app.set('port', process.env.PORT || 3000); //setting server port to 3000 var query="select label,urn from lmvmodeloption"; //to retrive the urn and label from lmvmodeloption //Mysql Connection //Get Function to check / //Logout function n }); //Server is Starting on port 3000
/* connection.query('SELECT email as first from user_login where email="jeevjyot.chhabda@whiting-turne"', function(err, rows, fields) { //this function checks if no session is set, redirect the user to the index page |
Hi @tjanczuk, I follow your above instruction, but still, I cannot retrieve my logged username, please help to resolve. My code below: app.js: Result: I got empty username and authenticationType, any thing i want to do in the code or iis config? Thanks. |
I created a basic Express web application and set up my web.config file like the documentation shows:
I'm developing on Windows 7 and have my node application hosted in the root directory of an IIS web site.
When I enter the URL http://localhost:8888/myapp.js, I get the following:
myapp.js is pretty basic:
If I run http://localhost:8000/myapp.js/debug, node inspector opens, but I don't see myapp.js in the list of loaded scripts. I see all of the express scripts and my routes/index.js script though.
Am I missing something or any hints on what to look for to fix it?
Thanks in advance.
The text was updated successfully, but these errors were encountered: