Reputation: 51
So I have just been getting into learning NodeJS as part of learning how to build a webscraping tool for a project I wanted to make.
I have all the content I need from the NodeJS file when I run the file directly through the terminal, but I wanted to know how to run the code directly from a website I am building to display the content I get from webscraping.
Any and all help is appreciated! (Also I am new to stackoverflow, so if you need any more info then I would be glad to help!)
Upvotes: 3
Views: 230
Reputation: 242
So you have working node application written in javascript. Perfect.
Now you want to run that in browser mode. you can use browserify for the same. Browserify will package all the nodejs module in a bundle and let you require from the browser.
Upvotes: 2
Reputation: 7030
Since Node.js runs on server side, you need to call the Node.js server through ajax and get the response back.
This website shows how to do Web Scraping in Node.js, now when you get the data pass it as a response to the browser.
You may also check Express.js which gives you "Fast, unopinionated, minimalist web framework for Node.js".
Upvotes: 2
Reputation: 209
Not exactly sure if this is what you are looking for, but you should look into a cloud9 space (its free) and using express to render the HTML. It's pretty straightforward.
Upvotes: 1
Reputation: 91
I think Nodejs tutorial in tutorialspoint [http://www.tutorialspoint.com/nodejs/] is powerful solution. It is just advice.
Upvotes: 0