Do I need ExpressJS in a retail site? Or how about NextJS?
I’m familiar with Sqlite3, and I’m eyeing MongoDB.
For further actions, you may consider blocking this person and/or reporting abuse
Do I need ExpressJS in a retail site? Or how about NextJS?
I’m familiar with Sqlite3, and I’m eyeing MongoDB.
For further actions, you may consider blocking this person and/or reporting abuse
Will T. -
Serif COLAKEL -
Alaa Mohammad -
Tirth Raval -
Top comments (5)
React is a front end library for Single Page Applications. It only manage your UI. You can use Express or any other backend framework for handling your application logic and database conection. Actually you may be interested in MERN stack who undestands for Mongo + Express + React + Node. Is a combination of JavaScript frameworks and libraries that can help you develop real good apps using js for all.
Ok 👍 so express is the middle part for handling the dB?
Exactly. Express handles the request from your front end and retrieves data from your database to your UI or sends the data from your UI to your database. It also do more staffs but basically that is the way it works
You should never make database queries directly from the front end, as this exposes your database to malicious activities. It means that you will need some kind of a back end service handling queries to the database. This is what Express and Mongoose is great for. Express handles all the end points for HTTP-requests made from the React site, while Mongoose handles the queries to the MongoDB without exposing the database. In other words, Express application acts as a m̶i̶d̶d̶l̶e̶w̶a̶r̶e̶ middle tier between the website and the database.
Middle tier rather than middleware.