NODE.JS Installation and First Project

Firstly Node.js powerful javascript version for servers. Node.js is used Google’s V8 javascript engine. If you want learn more information for node.js, you can use this link.

Installation

First we use this link for node.js setup.

0

Second we use terminal/cmd my computer is used unix system. Maybe, other platforms have a different rules. I write for unix/linux system. We will create project folder this code:

“mkdir computerLogWebPage”

1

Then we go to project folder and write this folder for express framework:

sudo npm install -g express2

Express is a framework for node.js. More information is here.

And we should install express-generator with this code:

sudo npm install -g express-generator

3

and we create express project with this code:

express blog

4

Then go to blog folder and write this code:

npm install” 

This code is installed what we need.

5

Third we should fix index.js and add this code:

“router.get(‘/blog’, function(req, res) {
res.render(‘blog’, { title: ‘Computer Log’ });
});”

 6

Then we create blog.jade file like this picture:

Screen Shot 2014-09-02 at 22.54.21

Jade like HTML.

Last we start project on localhost.

Go to terminale and write “npm start

Screen Shot 2014-09-02 at 23.23.05

And open browser go to http://localhost:3000/blog

Screen Shot 2014-09-02 at 22.54.45

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