Node.js / NestJS

Express.js Basics

Routing, middleware, requests/responses, static files, template engines, error handling

20 Interview-Fragen·
Junior
1

What is Express.js?

Antwort

Express.js is a minimal and flexible web framework for Node.js that provides robust features for building web applications and APIs. It simplifies routing, middleware, and HTTP request/response handling compared to vanilla Node.js. Express has become the de facto standard for Node.js web applications due to its simplicity and performance.

2

How to create a basic Express application?

Antwort

Creating an Express application requires importing the express module then calling the express() function to instantiate the application. This instance provides all necessary methods to define routes, middlewares and start the server. This is the first step of any Express application.

3

Which method defines a GET route in Express?

Antwort

The app.get() method is used to define a route that responds to HTTP GET requests. It takes two parameters: the route path and a callback function that processes the request and sends the response. This method is fundamental for creating REST endpoints.

4

What is a middleware in Express?

5

How to add a global middleware in Express?

+17 Interview-Fragen

Meistere Node.js / NestJS für dein nächstes Interview

Zugang zu allen Fragen, Flashcards, technischen Tests, Code-Review-Übungen und Interview-Simulatoren.

Kostenlos starten