This file contains 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
/* The API controller | |
Exports 3 methods: | |
* post - Creates a new thread | |
* list - Returns a list of threads | |
* show - Displays a thread and its posts | |
*/ | |
var Thread = require('../models/thread.js'); | |
var Post = require('../models/post.js'); |
This file contains 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
// Example taken from https://github.com/ciaranj/connect-auth/issues/45 | |
var fbId= "xxxxxxxxxxxxx"; | |
var fbSecret= "xxxxxxxxxxxxxx"; | |
var fbCallbackAddress= "http://localhost:3000/auth/facebook_callback" | |
var cookieSecret = "node"; // enter a random hash for security | |
var express= require('express'); | |
var auth = require('connect-auth') |
This file contains 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 querystring = require("querystring"); | |
var base64ToString = function(str) { | |
return (new Buffer(str || "", "base64")).toString("ascii"); | |
}; | |
var base64UrlToString = function(str) { | |
return base64ToString( base64UrlToBase64(str) ); | |
}; |