Node.js / NestJS

Express.js Basics

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

20 面接問題·
Junior
1

What is Express.js?

回答

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?

回答

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?

回答

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 面接問題

次の面接に向けてNode.js / NestJSをマスター

すべての問題、flashcards、技術テスト、コードレビュー演習、面接シミュレーターにアクセス。

無料で始める