simple test app for myself.I inserted some data in the database beforehand.App Effects:SummarizeIt used to be an iOS app or H5 app. Write the front and back desk on your own this time. A little breakthrough.When the front and back of the writing together, found before and after the platform, need a lot of cooperation. Before just the interface is not correct, look for background modification. This time it's your own amendment.This requires a lot of co-ordination. Just like at the beginning of t
" and "index.html" if you start the project now with an error.Then open the App.js file, comment a sentence, add two sentences, as follows:// App.set (' View engine ', ' Ejs '); Note This sentence // plus the following two sentences app.engine ('. html ', require (' Ejs '). __express); App.set (' view engine ', ' HTML ');And then start the project again, "Welcome to Express" reappears.Iv. installation of NodemonIn the command Prompt window, CTRL + C
. 2.2 Start MongoDB using the command line method,>mongod 127.0.0.1:27017--dbpath D:\mongodb\dbone//d:\mongodb\dbone MongoDB and Dbone folders to be set up first, in addition, the value of the--dbpath parameter can not be SpaceTwo. Create a project (Express)1 Installing the global plug-in >NMP Install-g Express //Automatic Download Express plugin
This article mainly introduces the login registration function of Node + Express + MongoDB. If you need it, refer to this article to introduce the login registration function of Node + Express + MongoDB, for more information, see
Inject MongoDB Dependencies
var mongoose = require("mongoose");
Because form processing
({ usernameField: ‘email‘, passwordField: ‘passwd‘ },(username,password,done) -> ...)4: when the verification succeeds, the session is established and maintained through cookies. Passport requires serialized and deserialized user instances to support sessions. Therefore, callback between serializeuser and deserializeuser is also required.
passport.serializeUser (user, done) -> done null, userpassport.deserializeUser (user, done) -> done null, user
5. Call
Verification triggered when a user se
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.