Example app in nodejs using handshake.js
JavaScript
Pull request Compare This branch is 1 commit ahead, 11 commits behind handshakejs:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
views
README.md
app.js
package.json

README.md

handshake-example-nodejs

Example of using handshake-js with a nodejs express app.

Usage

git clone https://github.com/scottmotte/handshake-example-nodejs.git
cd handshake-example-nodejs
npm install 
node app.js

Visit http://localhost:3000 in your browser.

We're going to need to see some ID

Requiring the user to be logged in prior to gaining access to your routes is easy. Open your app.js file and create new routes like this:

app.get('/rainbows', authenticate, function(req, res) {
	res.render('rainbows.jade');
})

This will call authenticate() prior to continue to render your view, making sure the user is logged in, or else they'll get redirected to /login

Deploying to Heroku

git clone https://github.com/scottmotte/handshake-example-nodejs.git
cd handshake-example-nodejs
heroku create
git push heroku master