Node.js / NestJS

Express.js Basics

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

20 domande da colloquioยท
Junior
1

What is Express.js?

Risposta

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?

Risposta

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?

Risposta

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 domande da colloquio

Padroneggia Node.js / NestJS per il tuo prossimo colloquio

Accedi a tutte le domande, flashcards, test tecnici, esercizi di code review e simulatori di colloquio.

Inizia gratis