현재 Node.js
및 Express.js
을 사용하는 웹 앱을 구축 중입니다.Node.js 사용자 이름 및 비밀번호 인증
이
을 app.js : 나는http://www.domain.com/login
에
post
요청을 수신하는 내 주요
app.js
파일에 사용자 이름과 암호를 사용하여 간단한 서버 측 인증을 할 수있는 방법을 찾고 있어요
app.post('/login', function(req, res) {
// some server-side code for a username and password
}
클라이언트 측에서 나는 사용자 이름과 암호가있는 간단한 로그인 양식을 가지고 있습니다. 이 양식은 서버에 게시로가는 :
index.html을
<form method="post" action="/login">
<input type="text" id="user" name="user" />
<input type="password" id="pass" name="pass" />
<button type="submit">Login</button>
</form>
내가 어떤 ExpressJS
플러그인이 없이 사용을 달성하기 위해 찾고 있어요.
편집 : 그럼 내 질문은 ExpressJS 및 NodeJS에서 간단한 사용자 이름과 암호 인증을 얻으려면 어떻게해야합니까?
좀 더 구체적으로 기재 할 수 있습니까? 실제로 질문하지 않았습니다. – JohnnyHK
http://devsmash.com/blog/password-authentication-with-mongoose-and-bcrypt – chovy