Node.JS ⬇️ Epress.JS
Building a Simple Calculator app.
If I want a personal website where I want to showcase my information and projects. This can be developed as a static website where the visitor can see your information. All he can do with that website is visual nothing more to interact. Later, in future, you added a feature like chat to your site. So here comes the Javascript which will enable the features to interact with the website to exchange information which makes the website dynamic we need to enable a backend service where you request some data and it responds with that data like a client-server model.
Initial days of Javascript, it was only able to run in the web browser. Then, Node.js was developed on the Chrome V8 engine(not the car V8) which enabled it to run outside the browser and make it suitable to develop backend services using Javascript.
What is Node.Js?
Node.Js ➡️ A cross-platform, open-source backend Javascript run-time environment. An async event-driven runtime environment helps to avoid dead-locking the process. Node.js directly performs I/O, so the process never blocks except when the I/O is performed using Synchronous methods of the Node.js standard lib.
Features of Node.js
The convenience of using a single programming language - Javascript
Cross-platform compatibility
Event-Driven Architecture
Single Threaded working - Non-blocking
Scalability
Community support and millions of packages
Installation of node js is found at ... >>> https://nodejs.org/en/download download suitable to your OS
What is Express.JS?
Express is a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications. With a myriad of HTTP utility methods and middleware at your disposal, creating a robust API is quick and easy.
How to use express.js in your project?
Node should be installed before continuing with express
step 1 : Navigate to the dir or create a new dir using the terminal or CMD
$ mkdir myapp
$ cd myapp
Step 2: Initialize an npm package in the dir
$ npm init
it will prompt details about the project and
entry point: index.js (can change it in package.json)
Step2: install express package
$ npm install express
This will create a modules folder in the project which installs all the required dependencies
Now check the package.json file wheater in dependencies express is added
Thats it for now will come back with a express app