Use EJS includes to extract common markup into one file
5
Secure the second route with Auth0
6
Create a simple Express-based API with a public endpoint
7
Pull API responses into the Web App using Axios
8
Create a private endpoint in the API
9
Pass authorization headers to the API from the Axios call
10
Configure the Web App to request an Access Token from Auth0
11
The final result and closing comments
Description:
Learn how to protect routes and secure API endpoints in a Node.js/Express application with authentication. Expand on previous knowledge by adding pages accessible only when logged in and creating a secured API called from the web app. Follow along to create a second route in the web app, implement EJS templating, secure routes with Auth0, develop a simple Express-based API with public and private endpoints, integrate API responses using Axios, and configure the web app to request access tokens. Gain practical insights into implementing authentication and authorization in your Node.js projects, enhancing the security of your web applications and APIs.
Protecting Routes and Securing API Endpoints in Node.js and Express - Part 3