Relative Content

Tag Archive for node.jsexpress

what kind of standard node/express app would u create to prep for a related interview?

I’m primarily a React developer. I have decades of full stack experience, but I’ve only used node/express for side projects. Ie I’ve never used it on a corporate/enterprise project – and I’ve never answered interview questions about it.
One of the most common interview questions related to hands on coding for React interviews is to implement a list of users and then filter it dynamically using a React implementation. That’s a pretty good reference model to put in place in vs code before an interview for prep and reference.
For those of you have done a few node/express interviews – what are some of the most common questions for node/express interviews? Based on my understanding – express is kind of the 80% scenario for implementing REST API with Node. Is that correct? So idk – maybe I can config a node/express setup and a CRUD setup with one example of each in my prep/reference project.
What kind of setup would you recommend for this?

Why can’t we use or export the express() instance in other modules / files instead of using Router() instance while segregating routes in Express

I’ve tried to created routes in other files by exporting the express app instance
const app = express() and
export default app, but I’m getting the 404 route not found error when I import app instance in another file; why is that? And why do we need to use Router() to segregate routes instead of just importing the app instance in other files / modules?

route with query string not working in express

I am not being able to retrieve the query strings that I sent through a specific route on a node server using req.query (url?var=value)
It seems that it never enters the route
if I modify the routes to use req.params it works
I would like to know what I am doing wrong