In Express.js, the ______ method is commonly used to protect routes and ensure that only authenticated users can access them.
- authenticate
- secure
- authorize
- validate
In Express.js, the authorize method is commonly used to protect routes and ensure that only authenticated users can access them. This is often achieved through middleware functions that check for authentication and authorization before allowing access. The other options may not be standard methods for this purpose in Express.js.
Loading...
Related Quiz
- When would you use export default over named exports in a module?
- How can you ensure that a specific version of npm is used in your Node.js project?
- You are developing a media hosting platform where users can upload images and videos. How would you design the file storage and retrieval system to ensure high availability and low latency for users across the globe?
- How can you ensure the security of file uploads in a web application?
- You are developing a large-scale application using Pug as a template engine, and you need to create reusable components. How would you create a reusable navigation component in Pug that can be included in multiple views?