This is a blank 'hello world' FeedHenry MBaaS. Use it as a starting point for building your APIs.
'Weather' endpoint.
| var mbaasApi = require('fh-mbaas-api'); | |
| var express = require('express'); | |
| var mbaasExpress = mbaasApi.mbaasExpress(); | |
| var cors = require('cors'); | |
| // list the endpoints which you want to make securable here | |
| var securableEndpoints; | |
| securableEndpoints = ['/hello']; | |
| var app = express(); |
| var express = require('express'); | |
| var bodyParser = require('body-parser'); | |
| var cors = require('cors'); | |
| var request = require('request'); | |
| function helloRoute() { | |
| var hello = new express.Router(); | |
| hello.use(cors()); | |
| hello.use(bodyParser()); |
| { | |
| "arrayOfStrings" : ["a", "b", "c", "d", "e", "f", "g"], | |
| "arrayOfNumbers" : [1,2,3,4,5,6,7,8,9,10], | |
| "mixedArray" : ["string", 0, { "object" : true }, false], | |
| "arrayOfArrays" : [[0,1], [1,1], [2,1]], | |
| "arrayOfObjects" : [ | |
| { | |
| "foo" : "bar", | |
| "foo2" : "bar2" | |
| }, |
| { | |
| "Description":"", | |
| "Id":"862b2c2e-860d-4afe-887b-f114a6527863", | |
| "Title":"products", | |
| "Fields":[ | |
| { | |
| "Id":"3b490ea1-7e4f-4075-9004-ee816955da4d", | |
| "InternalName":"b4x4", | |
| "Title":"color" | |
| } |
| document.getElementById('say_hello').onclick = function () { | |
| document.getElementById('cloudResponse').innerHTML = "<p>Calling Cloud.....</p>"; | |
| $fh.act({ | |
| act: "getTable", | |
| req: { | |
| "table": "allergy", | |
| "limit": null, | |
| "memberId": document.getElementById('hello_to').value | |
| } |
| var serviceId = process.env.EXAMPLESERVICE || "yourServiceIdHere"; | |
| var fh = require('fh-mbaas-api'); | |
| var express = require('express'); | |
| var mbaasExpress = fh.mbaasExpress(); | |
| var cors = require('cors'); | |
| var bodyParser = require('body-parser'); | |
| // list the endpoints which you want to make securable here | |
| var securableEndpoints; | |
| // fhlint-begin: securable-endpoints |
| var fhc = require('fh-fhc'); | |
| fhc.load(function(err){ | |
| if (err){ | |
| // Something went wrong | |
| } | |
| fhc.import({_ : ['projectId', 'appId', 'git://repoURL']}, function(err, importRes){ | |
| if (err){ | |
| // Handle error | |
| } | |
| console.log(importRes); |
Password restrictions are a constant pain in the ass. Most startup hipsters get this one right, but for every cool new startup, there's 10 websites with some archaic password restriction.
##Word Based Passwords
The advant of password managers such as OnePassword have made it easier to have unique, compliant passwords for every site you visit, but password validation on these sites still sucks.
Wouldn't it be nice if we could use unique, but memorable passphrases for the sites we use the most?
Unfortunately, most password validation focuses on the former case in this XKCD comic, and doesn't allow for word-based password schemes.
| process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"; | |
| var request = require('request'); | |
| request.post({ | |
| url : 'https://master00-bf85.oslab.opentlc.com:8443/oauth/authorize', | |
| json : true, | |
| auth : { | |
| user : 'andrew', | |
| pass : 'pass', | |
| sendImmediately : true |