Node.js tutorial part 1; setting up your environment by Patrick Sinke

Posted: October 17, 2016 in JDeveloper & ADF
Tags: , , , , , , , , ,

image

In a previous post I explained what Node.js is and how it works. Now, I’ll help you install it and create your first Node.js powered webpage.

I make the assumption you have some basic HTML and Javascript knowledge.

Node.js is installed as part of the npm installation. npm is a very powerful Javascript package manager that will save you tons of work when used properly. We at Whitehorses do not suffer from the “not invented here” syndrome!

Let’s get started quickly now. There are many ways to develop Node.js web applications, but I find myself comfortable with the combination of NetBeans and commandline npm.

After downloading and installing npm (there is plenty of documentation for that, for instance here), create a directory demonode, and use that as your working directory. Create a file named main.js containing the following code: When you execute the command node main.js, you will be able to access the page on localhost:8080.

Although it works like a charm, there is not much you can do with this page. At this point, you probably want to leave the command line behind and use a proper IDE.

But not before you entered this command in the working directory:

npm init

This results in a wizard which creates a package.json file. Read the complete article here.

WebLogic Partner Community

For regular information become a member in the WebLogic Partner Community please visit: http://www.oracle.com/partners/goto/wls-emea ( OPN account required). If you need support with your account please contact the Oracle Partner Business Center.

Blog Twitter LinkedIn Forum Wiki

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s