From 84624c11578a341ed4bfcec853bf1c58fbbeed98 Mon Sep 17 00:00:00 2001 From: tobyfee Date: Thu, 11 Dec 2014 14:53:46 -0800 Subject: [PATCH 1/3] add npm package --- node.js/package.json | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 node.js/package.json diff --git a/node.js/package.json b/node.js/package.json new file mode 100644 index 0000000..726e5cd --- /dev/null +++ b/node.js/package.json @@ -0,0 +1,31 @@ +{ + "name": "Janrain-Sample-Code", + "version": "0.0.0", + "description": "Sample Janrain Logins", + "main": "rpx.js", + "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": "git@github.com:janrain/Janrain-Sample-Code.git" + }, + "keywords": [ + "social", + "login", + "example", + "janrain" + ], + "author": "", + "license": "ISC", + "bugs": { + "url": "https://github.com/janrain/Janrain-Sample-Code/issues" + }, + "homepage": "https://github.com/janrain/Janrain-Sample-Code" +} From 09a4d62301c7d7dba839a3b3eb72a61e6c7de265 Mon Sep 17 00:00:00 2001 From: tobyfee Date: Thu, 11 Dec 2014 14:55:26 -0800 Subject: [PATCH 2/3] syntax fix --- node.js/rpx.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/node.js/rpx.js b/node.js/rpx.js index e7a3bfb..22b999e 100644 --- a/node.js/rpx.js +++ b/node.js/rpx.js @@ -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); @@ -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/'); \ No newline at end of file From 2d8d99400e15c3fcf2d9020bc390c07429f9fd28 Mon Sep 17 00:00:00 2001 From: tobyfee Date: Thu, 11 Dec 2014 15:44:46 -0800 Subject: [PATCH 3/3] remove unecessary package info --- node.js/package.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/node.js/package.json b/node.js/package.json index 726e5cd..43af357 100644 --- a/node.js/package.json +++ b/node.js/package.json @@ -1,8 +1,7 @@ { "name": "Janrain-Sample-Code", "version": "0.0.0", - "description": "Sample Janrain Logins", - "main": "rpx.js", + "dependencies": { "concat-stream": "~1.4.7", "ecstatic": "~0.5.7", @@ -23,7 +22,6 @@ "janrain" ], "author": "", - "license": "ISC", "bugs": { "url": "https://github.com/janrain/Janrain-Sample-Code/issues" },