Created
May 31, 2016 08:40
-
-
Save samcorcos/c5cbddbc21802730613f973f2407a4a9 to your computer and use it in GitHub Desktop.
index updated with auth middleware
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
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