Description
Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js' package ecosystem, npm, is the largest ecosystem of open source libraries in the world. in this video below, i explain how to creating sample static website using node.js.
What Will I Learn?
- How to create about, contact, home and convert it to html.
- How to create server function, request, response etc.
- How to combine about, contact, and home in one node.js server.
- Checking the active status of node.js with Command Prompt.
- Creating localhost.
Requirements
Write here a bullet list of the requirements for the user in order to follow this video tutorial.
- System Requirements: Program Install Support Install and Uninstall
- System Requirements: No special requirements
- OS Support : C, C++, JavaScript Operating system Linux, macOS, Solaris, FreeBSD, OpenBSD, Microsoft Windows (older versions require Cygwin), webOS, NonStop OS
- Written in : C, C++, JavaScript
Information
- Website & Download: https://nodejs.org/en/
- Type : Event-driven networking
- License : MIT[4]
Read more - Wikipedia
Difficulty
- Intermediate
Tutorial Contents
In this tutorial I explain how to create a sample website using node.js command.
the tools we need are
- Node.js
- Notepad ++, this is useful for editing html type files
- Command Prompt, to give commands and check status
- the first step is to create a folder with the name according to your needs, then open the folder and create again a new folder, as in the photo above for example, I created a folder on the desktop.
- then open the new folder, and create 3 new text document, then change the text document format to html. here I created a file with html format with the name about, contact, and home. you can see the photo above.
- then open the html file using Notepad ++ to create the html framework, do one by one of the three html files. then make the contents of the file about html and save, you can see the photo above.
- then continue by opening the contact.html and home.html files. then create contents like the photo above and save
- after you save and return to the main folder, here I use sample-folder website as the main folder, then create the text document again and change the format to js. edit the file format .js like in the photo above then save.
- Then to test the html we use Command Prompt, you can find the command prompt program on the Start menu and Search Command Prompt. Give cd desktop command on command prompt, then cd sample-website (name your main folder), then node sample website.js. If the way and the code you use is correct it will look like the photo above
Then continue by creating localhost on the static-website.js file. and you can change listen code to as needed. here I change listen to 8654. you can see the example of the localhost manufacture like the photo above. then save.
Then check the activation of localhost at the command prompt, if true then it will look like the photo above, and you can directly google to see the result, type "localhost: 8654" on google and it will look like the photo below :
Curriculum
this is my first tutorial on Node js.
Thank you for reading a tutorial !
Posted on Utopian.io - Rewarding Open Source Contributors
Thank you for the contribution. It has been approved.
My Opinion
You can contact us on Discord.
[utopian-moderator]
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Hey @portugalcoin, I just gave you a tip for your hard work on moderation. Upvote this comment to support the utopian moderators and increase your future rewards!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Hey @darsondrew I am @utopian-io. I have just upvoted you!
Achievements
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit