Skip to content

Instantly share code, notes, and snippets.

View varunkakkar's full-sized avatar
🎯
Working from Office

Varun Kakkar varunkakkar

🎯
Working from Office
View GitHub Profile
@varunkakkar
varunkakkar / index.js
Created May 2, 2017 11:30 — forked from jfensign/index.js
NodeJS User Registration and Authentication
//index.js
var express = require('express'),
app = module.exports = express.createServer(),
mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/nodeAuth');
//configure app
app.configure(function() {
app.set('views', __dirname + '/views');
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<hr>
<h1>Javascript Example</h1>