当我尝试运行我的代码时,它给出了参考错误:未定义LocalStrategy.
这是我第一次使用node.js而且我用这个打了一堵墙.我提前感谢你的帮助.
我将所有代码放在一个代码段中,以便您轻松完成.我已经尝试了其他帖子进行修复,但都没有成功.
/***********
Modules
***********/
//Load the express library
var express = require('express');
//Create a new variable called “app”; we pass on the express() method.
var app = express();
//Set Port
var port = 7878;
var mongoose = require('mongoose'); //Place this on top; Loads mongoose library
var bodyParser = require('body-parser');
var passport = require('passport');
var LocalStratgy = require('passport-local').Strategy;
/*Body parser*///whenever you do a post request from the form, it gets the data through a URL encoded format.
app.use(bodyParser.urlencoded({
extended: …Run Code Online (Sandbox Code Playgroud)