Socket.IO Cookbook by Tyson Cadenhead

Socket.IO Cookbook by Tyson Cadenhead

Author:Tyson Cadenhead [Cadenhead, Tyson]
Language: eng
Format: azw3
Publisher: Packt Publishing
Published: 2015-10-15T04:00:00+00:00


Now, let's create our userModel. This will be a MongoDB model that we can interact with to add and retrieve users, as shown in the following code:var mongoose = require('mongoose'); var db = mongoose.connect('mongodb://localhost/basicauthapp'); var userSchema = db.Schema({ firstname: String, lastname: String, password: { type: String, select: false }, email: String }); module.exports = db.model('User', userSchema);

Now for the client-side. We will need a container for our views to get rendered to:<div class="container" id="main-container"></div>



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.