- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
I'm not sure if the problem is related to XDK or the Edison.
If I use XDK/Edison combination to create a very simple server that listens on port 3000, I get the "Server Listening on port 3000" message on the XDK console, but openning up a web browser to localhost:3000 doesn't trigger the call back so I never see "Hello World".
- var http = require("http");
- var server = http.createServer(function(req, res) {
- res.writeHead(200, {"Content-Type": "text/html"});
- res.end("Hello World");
- });
- server.listen(3000);
- console.log("Server listening on port 3000");
If I do the same thing on my Ubuntu host at a nodejs console, it works as expected:
- See the Listening on Port 3000 message
- open a Chrome browser tab to localhost:3000
- this yields the "Hello World" Message.
Again, I don't know if it's related to the Edison or XDK so I figured I would run it by the experts ( that's you :c).
I can run basic node.js demos that use the console but seems like anything related to the network server, does not work.
I assum the version of XDK is 3522 ? (xdk_web_linux64_master_3522.tgz)
- Thanks in Advance
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
When you do this experiment on your Ubuntu machine your server and client are on the same machine, that is why the browser talking to localhost works in that environment, because the "server" named "localhost" which is running your Node.js server code is present. However, when you do that on the Edison your browser is not running on the Edison. "localhost" always means the machine on which the app is running, but the browser is not running on your Edison, where your Node.js server code is running. You need to substituted the IP address of your Edison board instead of "localhost" in your browser URL. The XDK does not redirect anything from your development system to the Edison, it's just a convenient tool for getting code onto your Edison and for seeing debug output from the Edison, nothing more.
BTW -- the editor inside the XDK is just the Brackets editor. You can also download and run it standalone.
링크가 복사됨
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
As a quick note, the reason I am using XDK and the Edison, rather than running the basic demos directly on my host, is because I like the Intel Editor and it's node.js awareness.
I've gotten into the happen of creating the basic demo using XDK but then run the runs on my host. However, I would be interested in getting it to work with the Edison Board just for the sake of learning more about the board and tools.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
When you do this experiment on your Ubuntu machine your server and client are on the same machine, that is why the browser talking to localhost works in that environment, because the "server" named "localhost" which is running your Node.js server code is present. However, when you do that on the Edison your browser is not running on the Edison. "localhost" always means the machine on which the app is running, but the browser is not running on your Edison, where your Node.js server code is running. You need to substituted the IP address of your Edison board instead of "localhost" in your browser URL. The XDK does not redirect anything from your development system to the Edison, it's just a convenient tool for getting code onto your Edison and for seeing debug output from the Edison, nothing more.
BTW -- the editor inside the XDK is just the Brackets editor. You can also download and run it standalone.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Hey Paul,
That was it ... I don't believe I missed that.
Thanks,
GB
