Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 18185

How to apply .htaccess in a node.js (express) application?

$
0
0

I have a node.js express application and I want to authenticate users using .htaccess (part of the requirement). I have added the initial .htaccess code however, it is not working.

Here is a snapshot of my code directory structure:Code Directory Structure

Here is the code snippet of my .htaccess file:

AuthType BasicAuthName "Please Enter Password"AuthBasicProvider file pamAuthUserFile ./.htpasswdAuthGroupFile ./.groupsRequire group admins

I have two other files .htpassword and .groups that includes the password and groups.

Any help would be appreciated!


Viewing all articles
Browse latest Browse all 18185

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>