Results 1 to 7 of 7
  1. #1

    Help with Node.js "Hello World"

    Hi, I just found out about Lightstreamers and I am attempting to create a Hello World page with Node.js following the totorial on Github. However there are several things I am confused about. Also to note, I am on a Linux Computer (Ubuntu)
    https://github.com/Weswit/Lightstrea...d-adapter-node


    -The tutorial fails to mention where I am suppose to save the helloworld.js file

    -I don't understand how to run

    node helloworld.The tutorial does not explain this, do I run this through terminal? Do I have to go to the directory of where "node" is installed? I also cannot run this through terminal because after starting the lightstreamer server through terminal, my terminal is "blocked" and new commands cannot run in it.

  2. #2
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    716
    Hi Jihua Zhou,

    I'm sorry that you had difficulty in following the instructions of the tutorial.

    Indeed, the helloworld.js file can be saved in any one of your work directories. Then you should open two terminals, one for the Lightsreamer server and the second to launch the nodejs adapter with the command "node helloworld.js".

    Alternatively, the Lightstreamer server can be launched in background with the appropriate launch script (background_start.sh).

    Hope that helps.
    Giuseppe

  3. #3
    Hi, thanks for the reply

    I have installed node.js, and confirmed it is installed correctly. However, I cannot get the light streamer node.js hello world to work.

    I only get
    HTTP Status 404

    Is there a way for me to check where my issue is?

    Also is there a way to confirm that "npm install lightstreamer-adapter" is functioning correctly?

  4. #4
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    The npm output will tell if it installed correctly. Also the node application will exit with an exception if it does not find a required module.

    You need to deploy the html page somewhere for it to be reached. Did you follow https://github.com/Weswit/Lightstrea...ent-javascript ?

  5. #5
    Yes, I did the Javascript front end, that is the web page I am attempting to access. And the node application did not exit with an exception for me.

  6. #6
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    Where did you put such html page?

  7. #7
    Senior Member
    Join Date
    Feb 2013
    Posts
    54
    First of all, you can check if the Lightstreamer server is correctly installed by pointing your browser to "http://localhost:8080"
    You should see a welcome page containing the links to some pre-installed demos. Click on the links to run the demos and verify if they work.
    In case of problems, errors are reported in the "Lightstreamer.log" file under the "logs" directory.
    If the demos are working correctly, you can check if the Proxy Data Adapter is actually connected to the Node.js Remote Data Adapter by checking the log file.
    You should see something like "Connected on port ...."

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 04:01 PM.