Nodejitsu: is there a way to password protect the apps?

247 Views Asked by At

using Nodejitsu: is there a way to password protect the apps? i'm not sure if i can deploy an .htaccess or so... i just need to protect the site from accidental visitors

thanks

1

There are 1 best solutions below

0
On
//Load express
var express = require('express');

//User validation
  var auth = express.basicAuth(function(user, pass) {     
   return (user == "super" && pass == "secret");
  },'Super duper secret area');

 //Password protected area
 app.get('/admin', auth, routes.admin);