Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Example app in nodejs using handshake.js
JavaScript
Branch: master
Pull request Compare This branch is 1 commit ahead, 11 commits behind handshakejs:master.
Failed to load latest commit information.
views change to doctype html
README.md Identify yourself!
app.js removed /test route
package.json Core of example app using handshake-js

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
Something went wrong with that request. Please try again.