Creating a minimal and flexible Node.js web application with Express
I started learning Express recently and I got amazed by realizing that how easy to get started with Express. If you are working with JavaScript mostly this will be super easy to learn. Especially if you are a frontend developer and wanted to get hands-on backend technologies this stack is perfect. So let’s dive into the article.
What is Express Js or Express?
Express.js, or simply Express, is a back end web application framework for Node.js, released as free and open-source software under the MIT License. It is designed for building web applications and APIs. It has been called the de facto standard server framework for Node.js.
Performance
Express provides a thin layer of fundamental web application features, without obscuring Node.js features that you know and love.
APIs
With a myriad of HTTP utility methods and middleware at your disposal, creating a robust API is quick and easy.
Getting Started
Before starting the installation make sure to install Node.js. Create your directory and initiate your package.json
file.
Installation:
npm install express
Hello world!:
Create your app.js
file just like in the screenshot.
Run the below command to start the server.
node app.js
If you followed the above steps congratulations! you created your first express app. Open your browser and visit http://localhost:3000
you’ll see “Hello World!”
Yeah, it’s that easy to create an app with Express. There are many popular frameworks that base on Express. Make sure to have a look at that one also.
This was about getting started with Express. Please make sure to go through the full documentation to get more. See you guys on the next one. Until then stay safe! ✌️
References:
[1]. Express.[2021] Docs [Online]. Available at: http://expressjs.com/en/guide/routing.html [Accessed 27 February 2021]