0

I have a create-react-app that I want to deploy but I'd like to make the access to the entire app password protected (at the web server level) so crawlers or anonymous users can't access the link without knowing the credentials.

The solution would be something similar to this but in node: http://www.elated.com/articles/password-protecting-your-pages-with-htaccess/

Is there any configuration that exist to support this in node for dev/prod environments?

Thanks a lot!

sinus
  • 33
  • 2
  • 6
  • You should provide more information about your server. React is a client side library so it doesn't really help determine the problem. – David Jones Jan 14 '17 at 21:45
  • I'm using the following react app sample to do this. I'm not sure what kind of node server it's using behind the scene: https://github.com/facebookincubator/create-react-app – sinus Jan 14 '17 at 23:15
  • "Builds the app for production to the build folder. It correctly bundles React in production mode and optimizes the build for the best performance." All it does it build the application. It doesn't serve anything. – David Jones Jan 14 '17 at 23:42
  • Got it, so if I would use Express, how can I make sure my webiste requires credentials to access it? – sinus Jan 15 '17 at 01:13

1 Answers1

0

I ended up using http-auth and ran into a problem that this post solved: Why http-auth does not work with express.static middleware?

Thanks for pointing me to a serving server that I missed.

Community
  • 1
  • 1
sinus
  • 33
  • 2
  • 6