Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Confused about BackboneJS and ExpressJS

I want to create a NodeJS application, and I am learning more about the packages that need to be installed to make development easier. Two packages in particular, ExpressJS and BackboneJS, are confusing me. What is the difference between the two? Backbone provides an MVC structure, but doesn't ExpressJS deal with views and controllers, too? How should I use these two packages in conjunction with each other, or should I even use them in conjunction with each other?

Thanks!

like image 903
egidra Avatar asked Aug 04 '11 15:08

egidra


People also ask

What is difference between Nextjs and ExpressJS?

Express. js is a backend framework for building APIs whereas Next. js is a full stack framework that builds upon React to improve the SEO, development experience, and performance of your project. One of these features IS a built-in API routing system that could replace Express.

What is the difference between ExpressJS and NodeJS?

Node. js is a platform for building the i/o applications which are server-side event-driven and made using JavaScript. Express. js is a framework based on Node.

Should I use Fastify or Express?

Fastify provides full encapsulation for plug-ins, automatically parses JSON with relatively faster rendering, and provides quick routing. Among other benefits, Fastify also has a cleaner syntax for writing async code in controllers. Express, however, has a stronger user base with plenty of documentation available.

What is the alternative of ExpressJS?

Koa, React, Flask, Django, and Golang are the most popular alternatives and competitors to ExpressJS.


1 Answers

Backbone is a front-end framework. Express is a back-end framework.

To further clarify, you could essentially run Backbone.js stand-alone with no backend support - just HTML, CSS, and JavaScript, and have "page switching" loading HTML templates through hash tag changes and load and save data through cookies or localStorage - but in the end your app needs to talk to a backend services for authenticating a user or saving / restoring data from a database, etc. That's where you'd want Express / node.js to comes in.

You could also do all this stuff without Backbone and just Express (or another backend language / framework), but then all your pages are separate requests to the server (unless you setup something custom on the front-end). Backbone, ajaxes that all out and lets you create templates beforehand, so all you need to request from the backend is plain data objects, and you're essentially only needed to load one page.

This is an oversimplification, but that's essentially it.

like image 80
Mauvis Ledford Avatar answered Oct 12 '22 07:10

Mauvis Ledford