In previous article, we describe more about the advantages using Node.js. Now, we will continue about how to develop your application using Node.js. Node.js has been getting a lot of buzz these days. If you want easier to develop your application, then the post is right for you and stay tune in this post.
How Node.js Run on A Server?
Let’s Get Started
As we know that Node.js is working fine on Linux system. But, don’t worry, now Node.js can be run on Windows Server too. If your hosting provider use Plesk Control panel, then you can easily find this option on control panel and you can use Node.js.
For your information, we try to develop our Node.js on our Windows Server and we never install Node.js previously on this server. So, here are the steps
1. Install Node.js
Node.JS isn’t native on any environment, so to begin, let’s head over to http://nodejs.org/, and install Node.JS for Windows.
Just click next until the installation complete.
Normally, if you are familiar with creating a .Net application, you create a new project/solution, write some code, or look at the sample, and hit play.
- Clicking Node.js brings up a blank command prompt with a >
- Clicking Node.Js command prompt brings up a command prompt
The next two link to documentation
2. Create Your Hello World
Let’s create your first project by creating your folder. Open your notepad and use this code
Ok, I have a file, hello.js, and inside I am writing Hello World to the console.
3. Execute the File
Perusing through the Node.JS documentation, I see that in order to execute a Node application, I open the Node.JS command prompt, navigate to my file, and type
4. Configure Notepad++
Notepad++ has tons of extra goodies, especially when you start adding plugins.
One such plugin I came across was NppExec, which allows you to execute commands/scripts within N++. Sounds like just what we need.
Great! We have Node installed, N++ is working as our editor, and we can execute using F5. It’s almost like being in VStudio!
Speaking of, if you are fortunate enough to have VStudio (Express version is free), then you can use the WebPlatform Installer to easily install and configure Visual Studio to start working with Node.JS. You can also use the Microsoft WebMatrix IDE