I am creating a basic user authentication using nodejs, express.js and Passport.js.
I follow this example and it kind of works for me:
BUT, I would like to modify this demo to not have routes and not a template engine (ejs)
I have a folder with a bunch of static html files I would like to protect.
I would like to password protect access to all html file under admin using basic authentication, but without routes.
In other words, I would like to access wepage.com/page2.html or any other html page and be redirected to login page, after logging in, I would like to be redirected back to page2.html and after that I could access the rest of the html pages without having to login. wepage.com/page4.html, wepage.com/page3.html, etc
The reason I don't want to have routes is because new html pages are added all the time and I don't want to keep creating routes for new ones or remove routes when deleting html pages.
Also, I don't really need a template engine since my pages are static html and I would like people to access the html directly. wepage.com/page1.html
The only requirements I have is nodejs, express.js and Passport.js.
Can someone please guide me or point me to an example to accomplish this?