Nodejitsu:有没有一种方法可以对应用程序进行密码保护

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

本文关键字:应用程序 密码保护 方法 一种 有没有 Nodejitsu      更新时间:2024-06-11

使用Nodejitsu:有密码保护应用程序的方法吗?我不确定我是否可以部署.htaccess左右…我只需要保护网站免受意外访客的

感谢

//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);