Node.js / NestJS

Express.js Basics

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

20 pytań z rozmów·
Junior
1

What is Express.js?

Odpowiedź

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?

Odpowiedź

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?

Odpowiedź

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 pytań z rozmów

Opanuj Node.js / NestJS na następną rozmowę

Uzyskaj dostęp do wszystkich pytań, flashcards, testów technicznych, ćwiczeń code review i symulatorów rozmów.

Zacznij za darmo