Skip to content

Instantly share code, notes, and snippets.

@samcorcos
Created May 31, 2016 08:40
Show Gist options
  • Save samcorcos/c5cbddbc21802730613f973f2407a4a9 to your computer and use it in GitHub Desktop.
Save samcorcos/c5cbddbc21802730613f973f2407a4a9 to your computer and use it in GitHub Desktop.
index updated with auth middleware
...
var auth = require('./auth')
...
app.post('/api/purchase', parseURLencoded, auth, function(req, res) {
var token = req.body.token
var amount = req.body.amount
stripeCharge.charge(token, amount)
res.status(201)
})
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment