odata-v4-server icon indicating copy to clipboard operation
odata-v4-server copied to clipboard

How to run the odata-v4-server on iis

Open egarim opened this issue 7 years ago • 3 comments

Hi I have a iis setup that is able to run node js files, for that i used this guide https://www.hanselman.com/blog/InstallingAndRunningNodejsApplicationsWithinIISOnWindowsAreYouMad.aspx

after the iis setup is done, basically I just need to point the browser to the url of the js file containing the server like this "http://localhost/node/helloworld/hello.js"

but i the case of the odata server to start it, I use the command npm start. so for me is not clear to which js file should I point to start the saver as I do when I use node in iis

egarim avatar Aug 22 '17 10:08 egarim

@egarim: you should target the index.js (lib/ts/index.js in the examples) or the main entry file for your server and should use the correct port by using process.env.PORT. odata-v4-server examples are using fixed port 3000. Although I don't know how IIS manages the URL after the script name to work with OData URLs.

lazarv avatar Aug 22 '17 11:08 lazarv

I will give it a try and give you an update on how it went ,if I make it work I will post another tutorial

From: Viktor Lázár [mailto:[email protected]] Sent: Tuesday, August 22, 2017 2:22 PM To: jaystack/odata-v4-server [email protected] Cc: Jose Ojeda [email protected]; Mention [email protected] Subject: Re: [jaystack/odata-v4-server] How to run the odata-v4-server on iis (#17)

@egarim https://github.com/egarim : you should target the index.js (lib/ts/index.js in the examples) or the main entry file for your server and should use the correct port by using process.env.PORT. odata-v4-server examples are using fixed port 3000. Although I don't know how IIS manages the URL after the script name to work with OData URLs.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jaystack/odata-v4-server/issues/17#issuecomment-323997104 , or mute the thread https://github.com/notifications/unsubscribe-auth/ACu2pKZh64R3OLPnp0MAtfZjgzaUQ8Lzks5sarnLgaJpZM4O-aLZ . https://github.com/notifications/beacon/ACu2pPzSSwEYGPKhHxNf1YO5NlLdrY8zks5sarnLgaJpZM4O-aLZ.gif

egarim avatar Aug 22 '17 11:08 egarim

Well so far I have been able to serve really basic files

Check this url

http://tinker.sv/node/node/lib/hello.js

the content of that file is this

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);

A really simple node js script

But when I try to run the server as you advised me

http://tinker.sv/node/node/lib/index.js

I got this error

https://www.screencast.com/t/iBK196q4n3P9

I’m going to contact the creator of the iis node module and let you know what he answer

From: Viktor Lázár [mailto:[email protected]] Sent: Tuesday, August 22, 2017 2:22 PM To: jaystack/odata-v4-server [email protected] Cc: Jose Ojeda [email protected]; Mention [email protected] Subject: Re: [jaystack/odata-v4-server] How to run the odata-v4-server on iis (#17)

@egarim https://github.com/egarim : you should target the index.js (lib/ts/index.js in the examples) or the main entry file for your server and should use the correct port by using process.env.PORT. odata-v4-server examples are using fixed port 3000. Although I don't know how IIS manages the URL after the script name to work with OData URLs.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jaystack/odata-v4-server/issues/17#issuecomment-323997104 , or mute the thread https://github.com/notifications/unsubscribe-auth/ACu2pKZh64R3OLPnp0MAtfZjgzaUQ8Lzks5sarnLgaJpZM4O-aLZ . https://github.com/notifications/beacon/ACu2pPzSSwEYGPKhHxNf1YO5NlLdrY8zks5sarnLgaJpZM4O-aLZ.gif

egarim avatar Aug 22 '17 12:08 egarim