First Node Application
After combining all these techniques, you can create a Node application. This code below creates a Hello World web-based application using Node.js.
javascript
// Require http header var http = require( 'http' ); // Create server http.createServer( function (req, res) { // HTTP Status: 200 : OK // Content Type: text/html res.writeHead(200, { 'Content-Type' : 'text/html' }); // Send the response body as "Hello World!" res.end( 'Hello World!' ); }).listen(8080); |
Node First Application
Node is an open-source, cross-platform server environment that executes JavaScript using the V8 JavaScript Engine. Node helps to write front-end and back-end code in the same language. It helps to write efficient code for real-time applications.
As a beginner in development, most developers find it difficult to create their first Node.js Application. In this article, we will help you in building Node applications.
We will discuss the following two approaches to create our first application in Node:
- Creating Console-based Node Application
- Creating Web-based Node Application
Contact Us