- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Tags:
- HTML5
- Intel® XDK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey Paul,
That was it ... I don't believe I missed that.
Thanks,
GB
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page