Node JS Server Example

Beginner Node JS Server Example with Routing

What is a Node JS Server?

Node JS gives the front-end developer (and back-end developers) the ability to use JavaScript (JS) as the back-end server-side scripting language instead of other back-end server-side languages. This is exceptionally useful for front-end JS developers looking to do server-side scripting as well. When you develop an application using Node, the application you write is the server. Node is a framework for you to build a web server. To setup and configure Node and NPM, see my tutorial.

beginner node js server
In the following Node JS Server tutorial, I will show you how to create a simple Node JS Server for serving static files using Routing. Routing tells our Node JS server which files (web-pages) to send the user based on the URL request, submitted by the user, through their web browser (Chrome, Firefox, Safari, etc.).

Our Node JS Server will serve a simple index.html file with a logo, and a 404.html file when the user requests a page that does not exist. It is simple to follow and gives you an idea of how NodeJS Servers work.

Continue reading


Setup a free JavaScript IDE with Sublime Text 3

Sublime Text 3 is a notepad replacement on steroids. However, it’s not just a colorful text pad, it can be transformed to a full-feature JavaScript IDE. It’s a neat, feature-rich, text-editor which allows developers to easily keep track of, and edit, their code. In my opinion it’s the best free JavaScript IDE. It is my favorite notepad replacement and coding tool, and there is no time limit on the unregistered version (unlike the 30 day trial period for WebStorm). After your license expires, you can continue to use the software however, if you do like it, I recommend buying it for $70.00 to support the Sublime team. Although WebStorm is also a great IDE, in this post I am going to show you how to setup a simple JavaScript IDE (Integrated Development Environment) in Sublime Text 3.

Sublime Text 3 is available for: WindowsLinuxMac/OSX

Continue reading