Hi!
If I've helped you, feel free to donate BTC or ETH to the addresses below, I appreciate it!
If you want to pay me via PayPal or GitHub Sponsors, you can use the buttons below.
Verifying my Blockstack ID is secured with the address 1FBJPttYvREtEcw7Vgd9gCZcRteERYuSma https://explorer.blockstack.org/address/1FBJPttYvREtEcw7Vgd9gCZcRteERYuSma |
module.exports = function(context, cb) { | |
cb(null, { | |
"id":"1", | |
"createdAt":1471984289, | |
"name":"name 1", | |
"authorId":63, | |
"directions":"directions 1", | |
"style":"style 1" | |
}); | |
}; |
module.exports = function(context, cb) { | |
cb(null, [ | |
{ | |
"key":"authorId", | |
"label":"Author", | |
"type":"number", | |
"required": true, | |
"helpText": "This is some help, yo!" | |
} | |
]); |
module.exports = function(context, cb) { | |
cb(null, [ | |
{ | |
"key":"name", | |
"label":"Better Name", | |
"type":"string" | |
}, | |
{ | |
"key":"authorId", | |
"label":"Author", |
module.exports = function(context, request, response) { | |
if (request.method !== 'POST') { | |
response.writeHead(400, { 'Content-Type': 'text/html' }); | |
return response.end('Must be POST request'); | |
} | |
if (context.body && context.body.grant_type !== 'authorization_code') { | |
response.writeHead(400, { 'Content-Type': 'text/html' }); | |
return response.end('grant_type must be "authorization_code"'); | |
} |
module.exports = function(context, request, response) { | |
if (request.method !== 'POST') { | |
response.writeHead(400, { 'Content-Type': 'text/html' }); | |
return response.end('Must be POST request'); | |
} | |
if (context.body && context.body.grant_type !== 'refresh_token') { | |
response.writeHead(400, { 'Content-Type': 'text/html' }); | |
return response.end('grant_type must be "refresh_token"'); | |
} |
module.exports = function(context, cb) { | |
if (!context.headers.authorization) { | |
return cb(403, 'Forbidden'); | |
} | |
if (context.headers.authorization !== 'Bearer a_token' && context.headers.authorization !== 'Bearer a_new_token') { | |
return cb(401, 'Unauthorized'); | |
} | |
cb(null, { |
module.exports = function(context, cb) { | |
if (context.body) { | |
if (!context.body.email || !context.body.pass) { | |
return cb(401, 'Unauthorized'); | |
} | |
} else if (!context.headers['x-token']) { | |
return cb(403, 'Forbidden'); | |
} | |
const now = new Date(); |