What is Express

Express is a relatively small framework, That sits on top of the node.js web server, functionality to simplify its APIs, and helpful new features. Express is built on top of Connect, providing tools and structure that makes writing web application easier, faster and more fun. It makes it easier to organize your application’s functionality with middleware and routing and adds helpful utilities to Nodejs’s HTTP objects. It facilitates the rendering of dynamic HTML views. It defines an easily implemented extensibility standard.

The functionality in Node.JS

Express is a relatively small framework, That sits on top of the node.js web server, functionality to simplify its APIs, and helpful new features. It makes it easier to organize your application’s functionality with middleware and routing. It adds helpful utilities to Nodejs’s HTTP objects. It facilitates the rendering of dynamic HTML views. It defines an easily implemented extensibility standard.

When you are creating a web application in node.js you write a single JavaScript function for your entire application this function listens to a web service request or the request from a mobile application concerning your API or any other client talking to your server when a request comes in the function will look at the request and determine how to respond if you visit the home page in a web browser, for example, this function could determine that you want the home page and it will send back some HTML if you send a message to an API endpoint this function could determine what you want and response with JSON the problem is that the node JS API can get complex to want to send a single JPG file that will be about 45 lines of code to want to create reusable HTML templates it is very complex node JS HTTP server is powerful but it misses a lot of features that you might want if you are building a real application Express was born to make it easier to write web applications with node JS.

What Express adds to node JS.


in broad strokes, Express adds big features to the node JS HTTP server
It adds a number of helpful conveniences to the node JS HTTP server abstracting away a lot of its complexity. For example, sending a single JPEG file is fairly Complex in Raw node JS (especially if you have performance in Mind), express reduces it to one line.
it lets you refactor 1 Monolithic request handler function into a much smaller request handler that handles only specific bits and pieces this is more maintainable and more modular.

Expresses minimal philosophy


Express is a Framework that means you will have to build your app in the Expressway but the expressway is opinionated; it doesn’t give a very rigid structure. that means you can build many different kinds of applications from Videojet applications to blocks to Apis.
it’s very rare to build an Express app of any size that uses only Express. express by itself probably doesn’t to everything you need and you will likely find yourself with the large number of other libraries that you integrate into your Express applications. you can have exactly what you need without any extra cruft, and it enables you to confidently understand every part of your application. in this way it lends yours itself well to the do-one-thing-well philosophy from the Unix world.
But this minimalism is a double-edged sword. It’s flexible and your apps are free of unused cruft, but it does very little for you in comparison to other frameworks. This means that you make mistakes you have to make far more decisions about your application’s architecture and you have to spend more time hunting for the right third-party models. you get less out of the box
Some might like a flexible framework, others might want more rigidity. Take for instance like Express but beta Framework on top of it that more strictly and forces conventions for their many developers. Express doesn’t care how you structure your apps so developers might make different decisions.
because you are given the reins to share your app in any direction, you might make an unwise decision that will bite you later down the line. To write less code yourself, you win duck hunting for the right property packages to use. sometimes it’s easy e there is one module that everyone loves and you love it too and it’s a match made in heaven. other times it’s harder to choose because there are a lot of Lokesh ones or a small number of 20 good ones. a bigger Framework can save you that time and headache you will simply use what you are given. there is no right answer to this and this book is going to try to debate the ultimate winner of the fight between big and small frameworks but the fact of the matter is that Express is a minimalist Framework for better or worse

I have added a few videos to learn Nodejs as well.

Spread the love