Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node.js example updated for v0.10 with npm #11

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions node.js/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "Janrain-Sample-Code",
"version": "0.0.0",

"dependencies": {
"concat-stream": "~1.4.7",
"ecstatic": "~0.5.7",
"request": "~2.51.0"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "[email protected]:janrain/Janrain-Sample-Code.git"
},
"keywords": [
"social",
"login",
"example",
"janrain"
],
"author": "",
"bugs": {
"url": "https://github.com/janrain/Janrain-Sample-Code/issues"
},
"homepage": "https://github.com/janrain/Janrain-Sample-Code"
}
7 changes: 4 additions & 3 deletions node.js/rpx.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var ecstatic = require('ecstatic');
var request = require('request');
var concatStream = require('concat-stream');

var staticHandler = ecstatic(__dirname)
var staticHandler = ecstatic(__dirname);

http.createServer(function(request, response) {
if (request.method === "GET") return staticHandler(request, response);
Expand All @@ -24,8 +24,9 @@ http.createServer(function(request, response) {
var url = "https://rpxnow.com/api/v2/auth_info?" + query_params;
console.log("Requesting URL: ", url);
request(url).pipe(response);
}))
}));
}
}).listen(5000);
)
.listen(5000);

console.log('Server running at http://localhost:5000/');