Node.js / NestJS

Express.js Basics

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

20 pertanyaan wawancaraยท
Junior
1

What is Express.js?

Jawaban

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?

Jawaban

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?

Jawaban

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 pertanyaan wawancara

Kuasai Node.js / NestJS untuk wawancara berikutnya

Akses semua pertanyaan, flashcards, tes teknis, latihan code review dan simulator wawancara.

Mulai gratis