Nate Nate - 4 years ago 307
Node.js Question

Javascript Frameworks

Can someone enlighten me on web frameworks using nodejs? I recently started learning express js from free code camp and while it's all going good I'm confused as to what express entirely is. Is it a full stack framework? Is it purely for backend? I see that you can use different templating engines along with it.

I see things where people say you can use front end frameworks along with it. If express is able to already render views, what's the point of using a front end framework.

Also, what's the difference between express and something meteor, vuejs or react? There's just so many buzzwords out on the web that it's confusing.

Answer Source

Express is a back-end web server framework that runs in nodejs. It is purely for the back-end, though you can define routes/endpoints in it that any front-end can make ajax calls to.

You use Express to make the handling of web server requests and responses easier and fasster. It has support for things like:

  1. Defining routes/urls/endpoints that you want to handle.
  2. Serving static web pages.
  3. Installing middleware for a wide variety of things including sessions and authentication.
  4. Hooking into one of many template rendering engines.
  5. Automatically parsing things like query parameters and form submissions.

Is it a full stack framework?

No. Express does not have a front-end component.

Is it purely for backend?

Yes.

Because Express has become so popular, there are also thousands of add-ins that can plug into express (often as middleware) for things like sessions or authentication.

Since it handles standard HTTP requests, you can use it with any front-end technology from just a plain browser to the many front-end frameworks.

Also, what's the difference between express and something meteor, vuejs or react?

Express is a back-end framework (runs on the web server). vuejs and react are front-end libraries (run in the browser). Meteor is a full-stack framework. On the back-end, it runs on nodejs and the front-end component runs in the browser.

I see things where people say you can use front end frameworks along with it. If express is able to already render views, what's the point of using a front end framework.

Yes, Express can serve the web pages you view and it can use a server-side template engine to render them. But, there's potentially a lot more to a front-end framework than that. For example, express provides nothing to manage a user's interaction with a page in the browser or the building of dynamic web pages that change based on user interaction. If you're building web pages that create, read and update data from a database, then Express by itself provides no automation for doing that while other frameworks can offer a lot of help with that. You could build all that in your own Javascript that would live in the web pages that Express was serving, but Express provides no help with that at all other than just delivering the Javascript that you wrote on your own.

If you want to know more about what front-end frameworks do, then I'd suggest you read about frameworks like react, vuejs or angular to understand their value proposition. I'm not saying that you have to use a front-end framework (because you do not). There are zillions of sites on the web that consist of some sort of back-end framework and then plain JS/HTML web pages. Whether a front-end framework would benefit your development depends on what you're doing and how well it aligns with what a particular front-end framework offers.

Here's are a couple good articles about what reactjs is:

ReactJS For Stupid People (fyi, I found it a very good article for smart people too).

What is React.js and Why I recommend it to other JavaScript Developers?

This article Full-Stack Frameworks contains a useful discussion of pre-built full-stack functionality such as Meteor vs. using a combination of technology such as MEAN (Mongo + Express + AngularJS + Node.js) or MERN (Mongo + Express + React + Node.js) and also touches on which technologies are more commonly used together.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download