Wednesday, October 18, 2017

Create Hello World project with Node.js and Express

In order to setup our environment, you can navigate to nodejs.org's site and then download their package and install it in your PC.



After you install node.js successfully, you can create your first node.js project by type some command like:

1. npm init : It will ask some basic information for your projects like  Name, Version, Description, Main, Author, and License... For some information, if you don't want to provide, you can press Enter key to skip (That info you can edit later in package.json). In your project, you will see package.json file.




2. Open your project with any Editors, for me, I use Webstorm IDE. And then we will install package Express by:
npm install express --save  : when you type --save, so it will write into package.json file with the dependencies section automatically.


3. Let's write some codes and then we will run our first "Hello World" project:


To run our project, please use cmd or default terminal in Webstorm.



Open your browser and then type: http://localhost:3000, you will see our "Hello World" message. Thank You!

6 comments:

  1. very useful blog to learner so happy to be part in this blog. Thank you.
    Full stack Online Training

    ReplyDelete
  2. very useful blog post Node Express Skeleton has a lot of features built in, and It has easy-to-use routing and simple support for view engines. starting a new server instance, configuring a view engine, setting up error handling and a lot more features you can get from other packages that integrate seamlessly node express skeleton

    ReplyDelete
  3. this is very useful blog post i am happy to know about it thanks for this post
    node express skeletonnode-express-skeleton

    ReplyDelete
  4. This particular papers fabulous, and My spouse and i enjoy each of the perform that you have placed into this. I’m sure that you will be making a really useful place. I has been additionally pleased. Good perform! rewriting history

    ReplyDelete